fix: allow modifier classes inside :is()/:not()/:where() with a base class - #49
Open
davidding wants to merge 1 commit into
Open
fix: allow modifier classes inside :is()/:not()/:where() with a base class#49davidding wants to merge 1 commit into
davidding wants to merge 1 commit into
Conversation
…class The selector-disallowed-list regex was a false positive on patterns like .base:is(.-mod-a, .-mod-b) because the second argument appeared after a comma-space, which matched the combinator pattern. Added a negative lookbehind to exclude matches inside :is()/:not()/:where()/:matches() when a base class precedes the pseudo-class. Also added a second pattern to flag :is(.-modifier) when used without any base class (i.e. :is() itself starts the selector or follows a combinator), which is a genuine violation the original regex missed.
davidding
marked this pull request as ready for review
June 19, 2026 15:30
darkmavis1980
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selector-disallowed-listwhere modifier classes (e.g..-mod-b) were incorrectly flagged when used as additional arguments in:is()/:not()/:where()with a base class (e.g..base:is(.-mod-a, .-mod-b)):is(.-modifier)has no base class before it (e.g.:is(.-mod-a, .-mod-b) .child)Behaviour
.base:is(.-mod-a, .-mod-b).base:is(.-mod):is(.-mod-a, .-mod-b) .child.-standalone .barHow it works
Two patterns replace the previous single pattern:
:is()/:not()/:where()/:matches():is((and siblings) when it appears at the start of a selector or after a combinator, meaning no base class precedes it🤖 AI-assisted draft — human review required
Test plan
.base:is(.-mod-a, .-mod-b) .childno longer triggersselector-disallowed-list:is(.-mod-a, .-mod-b) .child(no base class) is still flagged.-standalone .baris still flagged.base:not(.-mod-a, .-mod-b)passes