- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Controlling the order of CSS files
Is there any way to ensure that my child themes CSS loads BEFORE that of it's parent theme. I'm adding the CSS file in `default_head_block.xml`.
There seems to be a few work arounds to make the CSS file load further down the page, but not before an existing CSS file.
Surely with all the configuration options magento and xml provide, there must be a way?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Controlling the order of CSS files
Hi @mattgreenfield,
Maybe I miss understand the problem but if you have a child theme the right behavior is to be loaded AFTER the parent theme. Right?
Isn't that the idea with hierarchy?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Controlling the order of CSS files
Well yes, I see what you mean. I have child styles merging with parent styles in less, that makes styles.css.
The problem is that my child theme also wants to add a CSS file BEFORE styles.css. So that styles.css can override. Because styles.css is in the xml of my parent theme, it outputs first.
The odd thing for me is that we can't use 'before=""' in the xml like we can for blocks and containers. That's how I'd expect it to work anyway!