Closed Atronix1902 closed 3 years ago
Certainly not your fault 😃... this is due to an upstream change introduced in less v4.x where the math
mode is "parens-division"
by default (meaning that you have to wrap any math expression with a /
in parentheses).
The default for less v3.x was "always"
, leading to the difference in behavior that you're experiencing.
Two ways to fix this:
/
in parentheses: i.e. @i: (@index * 5 / 100);
math
setting to your settings.json
: e.g.
{
"less.compile": {
"math": "always"
}
}
Ideally, you'd be able to set the math
option in a per-file directive, but I've just tested and that isn't working atm. I'll try and get a separate release out for that.
Per-file directive is now available in Easy Less v1.7.2.
i.e.
// math: always
@index: 17;
@i: @index * 5 / 100;
.padding-17 {
padding: percentage(@i)
}
Hey, just found a bug, which occurred since version 1.7.0. The compiler throws an error when I try to use my for-loop.
Since this still worked on version 1.6.3, I don't think it is my fault.