Closed Dagur closed 1 year ago
This is by design and not a bug. For example, let's say you had this:
.test {
--width: 20px + foo({ 40: 'px' });
}
What should Less do with this? The value you have for --width
is 100% perfectly valid, and you could be intending to evaluate it as JavaScript, so it couldn't throw an error as an invalid expression. Instead, you have to evaluate it before-hand:
.test {
@width: 20px + 40px;
--width: @width;
}
Less evaluating at-rules in custom properties has its own add-in side-effects / bugs, but that's what is currently supported.
Maybe this bug should be about lack of documentation then? I tried to look this up and found nothing.
To reproduce:
Current behavior:
output is
Expected behavior:
I expected
Environment information:
less
version: 4.1.3nodejs
version: Whatever http://lesscss.org/less-preview/ usesoperating system
: Whatever http://lesscss.org/less-preview/ usesThis can cause unexpected problems when combined with less @variables.