Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
liuliangsir opened this issue Jan 5, 2024 · 4 comments
Closed
Labels

Comments

@liuliangsir
Copy link

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

@liuliangsir liuliangsir added the bug label Jan 5, 2024
@liuliangsir
Copy link
Author

@iChenLei cc

@matthew-dean
Copy link
Member

@liuliangsir That's a fascinating and bizarre bug. The first statements should have no effect on the statement following but somehow they do. 🤔

@puckowski
Copy link
Contributor

I have a fix for this issue that passes all tests. I will try to submit a PR sometime this weekend.

puckowski added a commit to puckowski/less.js that referenced this issue Dec 8, 2024
* Fix rebase issue for fix for issue less#4258.
puckowski added a commit that referenced this issue Dec 8, 2024
* fix(issue:4258) variable interpolation after math

* Fixes variable interpolation issue after previous variable addition.

* chore: fix rebase issue

* Fix rebase issue for fix for issue #4258.
@puckowski
Copy link
Contributor

Should be resolved via #4292
Less version 4.2.2

matthew-dean added a commit to matthew-dean/less.js that referenced this issue Feb 28, 2025
matthew-dean added a commit that referenced this issue Mar 1, 2025
* Added deprecation warnings

* Remove warning about combinator

* Switch to PNPM

* Update local dependencies

* Remove inner dist folder

* Create symbolic link to dist folder

* Flip dist folders

* Create symbolic link in root

* Add contributors

* 👥 Add @matthew-dean as a contributor

* 👥 Add @cloudhead as a contributor

* 👥 Add @lukeapage as a contributor

* 👥 Add @seven-phases-max as a contributor

* 👥 Add @iChenLei as a contributor

* 👥 Add @puckowski as a contributor

* Add more contributors

* Finish deprecation warnings

* Resolve deletions and such

* Fix symbolic link

* Update ci.yml to use PNPM

* Update ci.yml to use PNPM

* Refine CI versions

* Fix node printed version

* Better fix for #4258 and #4292

* Re-enable other tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants