Skip to content

Conversation

puckowski
Copy link
Contributor

What:

Fix for issue #4358 that correctly expands parent selectors in a list in a selector.

Why:

This Less:

.x:is(.x.a) {
  color: #f00;
}
.x:not(&.b, &.c) {
  color: #0f0;
}

.x:is(.x-a) {
  color: #f00;
}
.x:not(&-b, &-c) {
  color: #0f0;
}

currently becomes:

.x:is(.x.a) {
  color: #f00;
}
.x:not(&.b, &.c) {
  color: #0f0;
}
.x:is(.x-a) {
  color: #f00;
}
.x:not(&-b, &-c) {
  color: #0f0;
}

but should be:

.x:is(.x.a) {
  color: #f00;
}
.x:not(.x.b, .x.c) {
  color: #0f0;
}
.x:is(.x-a) {
  color: #f00;
}
.x:not(.x-b, .x-c) {
  color: #0f0;
}

I believe one existing test:

.selector:not(&:hover) {
  test: global scope;
}

may need to be updated to resolve to:

.selector:not(.selector:hover) {
  test: global scope;
}

Creating PR to discuss solution and the one failing test.

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

* Fix for issue less#4358 that correctly expands parent selectors in a list
  in a selector.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant