Skip to content

rule: parse arbitrary selector in not-[...] instead of escaping it#167

Merged
samoht merged 1 commit into
mainfrom
not-bracket-selector
Jul 26, 2026
Merged

rule: parse arbitrary selector in not-[...] instead of escaping it#167
samoht merged 1 commit into
mainfrom
not-bracket-selector

Conversation

@samoht

@samoht samoht commented Jul 26, 2026

Copy link
Copy Markdown
Owner

The not-[<selector>] variant treated any non-pseudo, non-media bracket content as a single class name, so not-[.os-macos_&]:block emitted :not(.\.os-macos_\&) instead of :not(.os-macos *) (and not-[.foo] gave :not(.\.foo), not-[[open]] gave :not(.\[open\])).

It now parses the bracket content as a selector, with _ as a space and & as the universal selector inside the negation, matching Tailwind. Invalid combinator-leading forms (not-[+img]) are still rejected upstream and emit nothing.

not-[<selector>] treated any non-pseudo, non-media bracket content as a
single class name, so not-[.os-macos_&]:block emitted :not(.\.os-macos_\&)
instead of :not(.os-macos *). Parse the content as a selector, with _ as a
space and & as the universal inside the negation, matching Tailwind.
@samoht
samoht merged commit c0aac44 into main Jul 26, 2026
2 checks passed
@samoht
samoht deleted the not-bracket-selector branch July 26, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant