Error with less in Sublime Text 2
-
21-12-2019 - |
Question
I have an error compiling my less file with ST2. I setup these plugins:
LESS
LESS build
SublimeOnSaveBuild
less2css
And I am trying to compile these example:
.generate-columns(4);
.generate-columns(@n, @i: 1) when (@i =< @n) {
.column-@{i} {
width: (@i * 100% / @n);
}
.generate-columns(@n, (@i + 1));
}
And I get this error:
Expected ')' but found ' ' on line 8 in file '......\public\css\prueba.less':
[7]: }
[8]: .generate-columns(@n, (@i + 1));
----------------------------^
[9]: }
[Done - Failed]
[Finished in 0.2s with exit code -5]
The example is from Less official web: http://lesscss.org/features/#loops-feature
Can anybody help me please? Is it a bug from plugin?
Thanks a lot, best regards.
Solution
Thanks to seven-phases-max, I realized that I was using a plugin with old Less version. Finally, everything is working ok with these plugins:
LESS
Less2Css
And I set Build in automatic. If saving you get this error: "error: less2css error: [WinError 2]", you can install node.js and then run in the terminal "npm install less -g". If you don´t want to install node.js, you can install LESS.js for Windows (https://github.com/duncansmart/less.js-windows) and add it to system path.