Skip to content

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

Closed
@liuliangsir

Description

@liuliangsir

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:

  • less version: 4.2.0
  • nodejs version: N/A
  • operating system: N/A

Workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions