2

In custom theme i have create file custom.less after Flush JavaScript/CSS Cache and Fersesh cache it compiling .less files to CSS. but after i change file custom.less this file not update. i tried set Client-side LESS compilation it not luck. So anysuggestion? Many thanks.

2 Answers 2

3

Try to re-deploy by command. Even if you are running in production mode

php bin/magento setup:static-content:deploy

Or you can do it manually by clear asserts and static files in

pub/static/frontend/[Vendor]/[YourTheme]/en_US/css
var/cache
var/view_preprocessed/css/frontend/[Vendor]/[YourTheme]/en_US/css
2
  • Thanks @mrtuvn so if i change custom.less i repear this. I want it automatic update when i change file less.
    – xanka
    Mar 21, 2016 at 4:58
  • 2
    I think it still bug in m2. Tested in apache 2.4.7 linux no symlink. I already delete less in pub/static in developer mode but magento not re-generate it again. Only re-gen in command way. Same problem with javascript files
    – mrtuvn
    Mar 21, 2016 at 7:59
0

Follow below steps:-

Just add new custom file here

app\design\frontend\Vendor\Themename\web\css\source\_custom.less

and import this file in source file given path below

app\design\frontend\Vendor\Themename\web\css\source\_sources.less

import your file

(if there is not available _source.less file in your theme then go to vendor\magento\theme-frontend-blank\web\css\source folder and copy file in your custom theme)

@import '_custom.less';
  1. clear cache
  2. php bin/magento setup:static-content:deploy

and your _custom.less changes will compiling with your theme .less files.

1
  • 2
    I tried this and it's not working
    – Scott
    Feb 13, 2019 at 19:00

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.