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

Add predefined @version variable

Open lee-elenbaas opened this issue 11 years ago • 6 comments
trafficstars

Add a predefined variable with the version number in some form as its predefined value Currently when using less with an external tool - there is absolutely no way to extract what version is used Such a variable will allow me to place it in the development/debug environment into some content file in order to find out what the less version is

lee-elenbaas avatar Apr 02 '14 15:04 lee-elenbaas

A built-in function (version) would be better than "special" variable. (More easy to implement, less burden for the compiler and more safe / backward-compatible).

seven-phases-max avatar Apr 03 '14 02:04 seven-phases-max

function is great - it will be more LESS specific than a value as well

lee-elenbaas avatar Apr 03 '14 06:04 lee-elenbaas

I considered trying to write this function but quickly discovered, while browsing the source, that the less.version attribute doesn't appear to be accessible from the less.tree attribute. It would seem that tree would need to be made aware of the version or its parent less object in order to access it.

zamtools avatar Apr 03 '14 06:04 zamtools

I think it will be alot easier on the 2.0.0 branch - feel free to make a pull request against that branch.

I've switched to using more structured requires so passing in dependencies is easier.

lukeapage avatar Apr 11 '14 06:04 lukeapage

Is this issue still up for grabs? I seems really dated, but the issue has not been closed yet.

kevinramharak avatar Jan 04 '19 21:01 kevinramharak

Is it somehow possible to render the less version that was used to compile the css file into a comment of that css file?

mkurz avatar May 08 '24 18:05 mkurz