0

In magento2.0.2(downloaded from magentocommerce.com), after installation I created a new theme under app/design/frontend/mypackage with theme.xml , registration.php , composer.json as per the documentation.And then I inherited the blank theme by copying the theme files from vendor/magento/theme-frontend-blank into mytheme folder. Everything was fine. Now, when I add some style in theme.less in web/css/source and compile it using grunt , the styles are getting applied. But when I edit some of the existing styles or when I created a new less file with some styles, the styles are not getting applied.

Someone kindly explain me the reason behind this.

After doing any changes when i run php magento setup:static-content:deploy at front it is showing error like

enter image description here

4
  • do you deployed the static files????
    – Asish Hira
    Commented Apr 12, 2016 at 5:47
  • Should I run the command ` php magento setup:static-content:deploy` after editing any style?
    – Ramya
    Commented Apr 12, 2016 at 6:04
  • Yes! this will deploy all static file
    – Asish Hira
    Commented Apr 12, 2016 at 6:08
  • check my answer
    – Asish Hira
    Commented Apr 12, 2016 at 6:14

1 Answer 1

0

After any css file or js file change. You need to deploy those static files to your pub static files!

So follow this steps-

  1. Go to var folder and delete view_preprocessed folder
  2. Also delete theme locale folder located in pub/static/frontend/spacename/themename/
  3. Now from your magento root run php bin/magento cache:flush & php bin/magento setup:static-content:deploy

Now your new files are ready!

11
  • can i use grunt clean to delete locale file in pub/static/frontend/spacename/themename/
    – Ramya
    Commented Apr 12, 2016 at 6:56
  • what system you are using??
    – Asish Hira
    Commented Apr 12, 2016 at 7:06
  • do you mean what os am using?
    – Ramya
    Commented Apr 12, 2016 at 7:07
  • Yes!!!!!!!!!!!!!!!!
    – Asish Hira
    Commented Apr 12, 2016 at 7:27
  • You can delete without using any command
    – Asish Hira
    Commented Apr 12, 2016 at 7:28

Your Answer

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

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