Encapsulated .loop function in LESS
bower --save install loopless
.loop-in(@selector, @index, @from, @to) when(@selector = '.fader') {
&--level-@{index} {
content: '@{index}';
volume: (@index - @from);
}
}
.loop(in, '.fader', 50, 100);
.fader--level-0 {
content: '50';
volume: 0;
}
.fader--level-1 {
content: '51';
volume: 1;
}
...
.loop-over(@selector, @index, @from, @to) when(@selector = '.fader') {
&--level-@{index} {
...
}
}
.fader {
.loop(over, '.fader', 0, 50);
}