Magento2 CSS – How to Regenerate in pub/static Folder

cssdeploymagento2static-content-deploy

I have installed Magento 2 and set developer mode, then I have installed one module that contains css and js files. The module works fine and css and js files are rendering from pub/static folder. Now I have made css changes in module directory css file and run command

php bin/magento setup:static-content:deploy

but Magento is not making my new changes in pub/static css files so I'm getting old css file contents.
Does anyone know how to regenerate the whole css file in pub/static folder?

Best Answer

Before deleting pub/static make a backup of pub/static/.htaccess and restore it again. otherwise your all css and js will show 404 error!

  1. Remove pub/static (keep the .htaccess backed up and copy it again)
  2. Remove var/cache
  3. Remove var/composer_home
  4. Remove var/generation
  5. Remove var/page_cache
  6. Remove var/view_preprocessed
  7. Run php bin/magento setup:static-content:deploy
Related Topic