less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
16.99k stars 3.41k forks source link

Variable interpolation with math operator like + is not compiling properly #4258

Open liuliangsir opened 6 months ago

liuliangsir commented 6 months ago

To reproduce:

@a: 1px;
@b: 2px;
@c: @a + @b;

@radio-cls: radio;
@radio-cls-checked: @{radio-cls}_checked;

.@{radio-cls-checked} {
  border-color: #fff;
}

Also here is a online playground for reproducing the issue above.

Current behavior:

._checked {
  border-color: #fff;
}

Expected behavior:

.radio_checked {
  border-color: #fff;
}

Environment information:

Workaround

liuliangsir commented 6 months ago

@iChenLei cc