Magento – Magento 2 – Quick css amends without having to deploy static content (during development)

magento2

This question has been asked a few times but I have yet to find the definitive answer.

When making small css tweaks to the my theme (in developer mode) it seems that in order to see them on the frontend I have to follow these steps to get it to show:

1) Deploy static content for en_GB (my theme/locale)

2) Deploy static content for en_US (admin)

3) Reset file permissions on pub/static – otherwise everything is forbidden.

4) Clear cache

5) Reload frontend

This seems crazy in order just to see a font change colour!

Surely I must be missing something??

Is there a quick way to make css changes?!

Magento ver. 2.0.5

Best Answer

You can use client-side compilation:

  1. In the Magento Admin, change the LESS compilation mode to client-side under STORES > Configuration > ADVANCED > Developer > Front-end development workflow > Workflow type. For detailed description see the CSS preprocessing topic.

  2. Delete all files in the following directories: pub/static/frontend// var/view_preprocessed/less

Instructions taken from the Dev Docs - http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-guide/css_quick_guide_mode.html

Although I recommend using your own Gulp/Grunt setup over the build-in ones but that's a larger task than one admin setting.

Related Topic