You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
**:not()** with a selector list doesn't expand & symbol #4313
:not(&--a):not(&--b) does expand the & symbol into the parent's selector as expected. :not(&--a, &--b) doesn't expand the & symbol into the parent's selector.
We are currently in the middle of a battle of linters. We are told :not(a):not(b) is being classed as complex, and should be changed to :not(a, b)but it appears less forgets to expand when this feature is being used.4.2.2at least compiles the syntax (though incorrectly) our older version4.1.3` just keels over completely.. So I am guessing this is a relatively new feature and hasn't had much usage yet.
The issue you're encountering with the & symbol not expanding within a selector list inside :not() is a known limitation in Less. In version 4.2.2, there was a fix related to nested pseudo-selector parsing, which might have improved some aspects of handling :not(), but it seems that the specific case of selector lists within :not() still doesn't expand the & symbol as expected [1].
This behavior indicates that Less currently does not support expanding the & symbol within a selector list inside :not(). The workaround would be to avoid using selector lists in :not() when you need the & symbol to expand, and instead use separate :not() pseudo-classes as you did in the .works example.
If this is causing issues with linters, you might need to adjust the linter rules or continue using the workaround until a future update potentially addresses this limitation.
Activity
dosubot commentedon Jan 30, 2025
The issue you're encountering with the
&symbol not expanding within a selector list inside:not()is a known limitation in Less. In version 4.2.2, there was a fix related to nested pseudo-selector parsing, which might have improved some aspects of handling:not(), but it seems that the specific case of selector lists within:not()still doesn't expand the&symbol as expected [1].This behavior indicates that Less currently does not support expanding the
&symbol within a selector list inside:not(). The workaround would be to avoid using selector lists in:not()when you need the&symbol to expand, and instead use separate:not()pseudo-classes as you did in the.worksexample.If this is causing issues with linters, you might need to adjust the linter rules or continue using the workaround until a future update potentially addresses this limitation.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
WORMSS commentedon Jan 30, 2025
I am guessing @puckowski would be the best person for this type of issue? Due to his work on the latest fix for listed selectors?
puckowski commentedon Jan 30, 2025
Thank you for the issue report. I'll spend some time this weekend on this issue and I will try to come up with a fix PR.
puckowski commentedon Jan 31, 2025
I think I have a fix. Will work on adding more tests and try to get a PR submitted this weekend.
fix: issue less#4313 selector with comma
fix: issue less#4313 make solution more flexible
fix: issue less#4313 add more tests
fix: issue less#4313 cleanup merge issues
puckowski commentedon Feb 1, 2025
PR #4314 should resolve this issue, but it looks like we may be having new CI problems.
puckowski commentedon Feb 1, 2025
FYI figured out the new CI issue so PR #4314 can be merged after review.