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

Question: Any way to edit global variables dynamically

Open elfassy opened this issue 15 years ago • 16 comments

Say i have a less file with a bunch of global variables (@variable...) would it be possible for me to change their value using JavaScript (after the page is loaded)? Thanks!

elfassy avatar Feb 22 '11 17:02 elfassy

When the page loads, the stylesheet is compiled to CSS. You'd have to access the syntax tree, modify the variable, and recompile it. It's possible, just complicated.

cloudhead avatar Feb 26 '11 00:02 cloudhead

Any way to use the loadStyles function (doing a search and replace in a