I have a less file colours which defines looks like the following:
@black: #000;
@greyDarker: #222;
...etc
And want to be able to access these from within javascript, so for example:
$('body').style('color', 'window.colours.black') // or however I assign them
would work.
Since Less is getting compiled server-side the usual options wouldn't work.
I've started going ahead and writing a grunt task to generate a js file from these less rules however this seems like an inefficient / hacky way to go about it.
Any suggestions on a better approach or tools that could help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With