-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom .css files not loading in browser head added via default_head_blocks.xml in Magento 2.0.4 child theme #4274
Comments
Shashankitsoft, thank you for reporting the very detailed issue. Your steps to reproduce (installing two themes as described: Magento_blank -> Paid_Theme -> My_Child_theme ) are correct. We went through the steps, but we cannot reproduce the issue. Please try to go through the steps again more carefully, perhaps you miss something out of focus. And give us your feedback. |
Thank you for the response. From the time I posted this issue, I myself digged into it much to find the reason. And found out that there is no issue if the child theme and its parent paid theme (child of magento blank) are under the same vendor folder. But if the folder name is different for child and parent then this issue occurs, that no .xml files of childtheme processed while rendering in browser. That's why I posted a second issue #4330 more detailing the new steps for reproducing this issue. Please refer to newer one here: #4330 Thanks. |
@shashankitsoft should we close the issue, since it is new one created? |
Hi, |
Steps to reproduce
I mean the hierarchy of my child theme is Magento_blank --> Paid_Theme --> My_Child_theme
Then I want to add css styling file in head of my child theme, so added mycustom.css file in app\design\frontend\company\childtheme\web\css\mycustom.css and also created app\design\frontend\company\childtheme\Magento_Theme\layout\default_head_blocks.xml with content
<page …><head><css src="css/mycustom.css" /></head> </page>
The process was exactly followed as per the Magento 2 instructions on http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html#layout_markup_css
php bin/magento setup:static-content:deploy
, and mycustom.css file then available in pub/static but still not included in browser html .php bin/magento indexer:reindex
andphp bin/magento setup:upgrade
, still no success.Expected result
As my theme is a child theme of a parent theme which is a child theme of Magento_blank and created with the rules as defined by magento, mycustom.css should have included in while running in browser.
Although, I have checked, that parent theme is also using the same way to load their custom.css by putting in web/css and adding in layout\default_head_blocks.xml. Their custom.css is loading properly in browser.
Why not my child theme unable to add mycustom.css the same way then?
Actual result
mycustom.css of my child theme not loaded anyway in browser even all above steps tried. I am unable to customize y site therefore.
I suspect this is a serious bug in magento 2, which is unable to load custom css files via layout\default_head_blocks.xml in child themes. Searched for solutions alot on internet, tried everything but nothing worked. Also, no where is mentioned if Magento 2 needs some parameters to set in a theme to allow it act as a parent theme and allow custom css addtions in its child theme.
The text was updated successfully, but these errors were encountered: