3

I have customized Magento 2 home page using custom theme extends from luma theme.

While Header customization, change color "header.wrapper" it's not reflecting. But some other properties are working.

For Example Change body background color its working fine. Some properties class only not working.

Example:

I added my less file

vendor/Themename/web/css/mycss.less.

  .panel.wrapper {
   background-color: green;
 }

This is my default.xml file:

vendor/Themename/Magento_Theme/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
    <css src="css/mycss.css"/>
    </head>
</page>

I am using grunt compilation, so grunt convert less to css and store to pub/static. and mycss file calling while execute this page, but not reflecting.

But I change via firebug its working fine.

Why? Suggest me how to solve this?.

4

3 Answers 3

2

I am replying to this question, as it hadn't been answered effectively yet. CSS is not reflecting because there is an issue with the cache. So, to fix the issue, you have to clear the cache. To do it, run the following codes one by one:

  1. rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/*
  2. php bin/magento setup:static-content:deploy
  3. php bin/magento cache:clean
  4. php bin/magento cache:flush
1

Create your theme on below path given instead of vendor folder

app\design\frontend\vendor\themename

and apply theme from admin and clear cache, whenever you add new files in your theme you need to deploy static content from cmd command given below.

php bin/magento setup:static-content:deploy
1
  • I already did this its not work for me, css working fine, but when chage "header.wrapper"(home page header) its doen't work. Aug 5, 2016 at 11:50
1

-app
--design
---frontend
----VendorName
-----VendorTheme
------Magento-Theme
-------layout
--------default.xml
--------default_head_blocks.xml
------media
-------preview.png
------web
-------css
--------yourcss.css
------registration.php
------theme.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.