Skip to content Skip to sidebar Skip to footer

Is Javascript Evaluation Working In LESS (Leaner CSS)?

I am using LESS ( http://lesscss.org ) and it says ... JavaScript evaluation JavaScript expressions can be evaluated as values inside .less files. This is done by wrapping the exp

Solution 1:

I am working on the same thing. The way I have been testing the expression is to compile the less file in the browser as you are doing (I am using firefox with firebug). I inspect my rendered css by inspecting the head section of the rendered page and looking for <style id="less:yourLessFileName-less-styles" type="text/css"> . Twirl that file open and you will see the compliled css. Scroll down until you find your selector and rule you are using the javascript expression for and see how it rendered.


Solution 2:

You probably can't call variables created in JS. From what I understand, JavaScript expressions can be evaluated means just that you can evaluate stuff with JS functions and use default JS objects like document.body.clientHeight which doesn't mean that you can call variables from a different file and location. It just doesn't make sense that it'll let you do that, how is it supposed to find the variable?. I might be wrong tho..


Post a Comment for "Is Javascript Evaluation Working In LESS (Leaner CSS)?"