These are chat archives for less/less.js

10th
Dec 2015
Joep van Liempd
@joepvl
Dec 10 2015 00:55
Just want to say I went back and looked through the Less source again, particularly at everything surrounding render, parse, Parser, and ParseTree. My understanding of what the in-browser modifyVars actually does was indeed lacking quite a bit -- basically it's much less fancy than I thought (and was hoping) it was :smile:.
I was under the impression that it did some cool ("magic") stuff, keeping the parse tree in memory and modifying variables' values directly in there, foregoing the need to parse the original Less string again only because of the need to modify a small part of it. This is not the case as far as I can tell (and I'm not even sure it would be possible, or even desirable in terms of perf gains; I'm inexperienced with the whole subject of parsers/ASTs/renderers).
Joep van Liempd
@joepvl
Dec 10 2015 01:06
And so, as I'm already taking care of loading/concatenating the Less files I need in my own code anyway, I'll just be using less.render and "modifying the vars" before passing it the final string each time I want to rerender my CSS. If I end up running into perf problems with doing it this way, I'll probably want to revisit this. I imagine at some point I'll be trying PostCSS on the client side, seeing as I only plan to use a relatively small subset of the full Less functionality (variables, nesting, some calculation, and perhaps some of the colour functions).
Junaid Anwar
@Juni4567
Dec 10 2015 13:22
Anyone know how to iterate in less ? (similar to the following code does in sass)
@each $icon in cardboard, chevron-left, chevron-right, expand, image, mail, mouse-pointer, pencil, qoute-left { icon-.#{$icon} { background-image: url('/images/#{$icon}.svg'); } }
Zephraph
@zephraph
Dec 10 2015 22:18
I'm starting to look at #1485.
Zephraph
@zephraph
Dec 10 2015 22:56
So is there any way to get more detailed output from the tests?