Less templates appear to be in strict maths mode (ie more parentheses)

Xon

Well-known member
Affected version
2.3.0 Beta 4
Math expressions in .less templates seem to now require being wrapped by parentheses e.g.
Code:
property: (0.8 * @xf-style-property);
Previously this was only necessary if the expression was ambiguous (such as multiple padding values).

I haven't seen this reported as a bug.

But this makes porting less to XF2.3 quite annoying as it is unsure when existing less will work as-is or just fails silently.
 
Yeah, drove me a bit crazy too; did some refactoring to compensate, but I'm sure I missed something in one of ours..
 
But this makes porting less to XF2.3 quite annoying as it is unsure when existing less will work as-is or just fails silently.
It might also fail quite noisily:

Code:
.depthLoop(@i) when (@i <= 10)
{
    &.dataList-cell--d@{i} span.iconic-label { margin-left: -(@i - 1) * 25px; }
    .depthLoop(@i + 1);
}
.depthLoop(1);

This works fine in 2.2 but causes a memory overflow (due to an endless loop?) in 2.3

Changing this to
Code:
.depthLoop(@i) when (@i <= 10)
{
    &.dataList-cell--d@{i} span.iconic-label { margin-left: (-1 * (@i - 1) * 25)px; }
    .depthLoop((@i + 1));
}
.depthLoop(1);
seems to work fine (for both 2.2 and 2.3)
 
Back
Top Bottom