less.js icon indicating copy to clipboard operation
less.js copied to clipboard

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

Open tribhuvandurgam opened this issue 5 years ago • 1 comments

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 ?

tribhuvandurgam avatar May 04 '20 19:05 tribhuvandurgam

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.

stale[bot] avatar Dec 25 '20 13:12 stale[bot]