0

I can't figure out how to get the LESS files in my theme to update. I've tried every different .less file the docs recommend. I've tried copying this file from samples:

https://github.com/magento/magento2-samples/blob/master/sample-module-theme/web/css/source/_theme.less

to the same exact spot in my own theme (/app/design/frontend/Grant/knit/web/css/source). I'm running in dev mode, clearing the cache, and forcing static deploy (even though I shouldn't have to), and I can't get the changes to register.

2 Answers 2

0

You need to use _extend.less instead _theme.less then flush cache and use

php bin/magento setup:static-content:deploy

0

You can import your less file in _extend.less like bellow

// Custom Less
 
@import 'theme/_custom.less';   
@import 'theme/_navigation.less'; 
@import 'theme/_theme.less'; 

NOTE:- Run bellow commands

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f  
chmod 0777 -R var/*
chmod 0777 -R pub/static/* 
chmod 0777 -R generated/* 

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.