less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17.02k stars 3.41k forks source link

modifyVars values are not considered when imports are inside a class selector #3497

Open tribhuvandurgam opened 4 years ago

tribhuvandurgam commented 4 years ago

style.less

.my-app { @import url("variables.less"); color: @text-color; background-color: @body-bg; }

variables.less

@body-bg: #f1f2f3; @text-color: #5e5e5e;

Compiling with

modifyVars: {"body-bg": 'yellow', 'text-color' : 'purple' }

Style.css is (modifyVars are not considered here)

.my-app { color: #5e5e5e; background-color: #f1f2f3; }

But when import is moved outside the selector in style.less

@import url("variables.less"); .my-app { color: @text-color; background-color: @body-bg; }

Style.css is as expected.

.my-app { color: purple; background-color: yellow; }

How to have the "modifyVars" values honored for import inside class selectors ?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.