I'm using Ubuntu with Magento 2.2 installed locally for development.
I'm updating my LESS, but it's just not compiling for some reason.
I have all caching turned off in Cache Management, and I run magento setup:static-content:deploy -f
after any LESS modifications, but it's still not compiling and showing my changes. I just changed a css padding value from 10 to 11 to test, and it's still set to 10.
I also have caching turned off in my browser, too. And I've ran rm -rf var/view_processed
then static content deploy, but that didn't work either.
Also, My Workflow Type is set to Server side less compilation, and the local install of Magento 2 is set to Developer Mode.
So I'm at a loss for what to do to get my LESS to compile into CSS. It's just not doing it for some reason.
Any ideas?
Thank you.
Best Answer
Did you delete the compiled file in the
pub/static
folder first? You should delete those css files (thestyles-m.css
and thestyles-l.css
), clear thevar/view_preprocessed
folder and then run compile.In some cases, the files in the pub will create sym links to the source file. When that is a the case, you don't have to delete it first, so check the
pub
folder to see the state of those files (this is a setting in theapp/etc/di.xml
but it a whole other question to configure this).If nothing is working after that, you should check the file you are working on itself. You should be editing the:
And then if nothing is working check the file permission for the
pub
andvar
folders. While working in development, i run these folder with open permissionsudo chmod -R 777 pub/ var/
. But note that when you push live, if you are moving these directories directly, these permission might be too open (i push code with git so i don't have to worry about generated file and directories).