stylesheet: parse nested rules starting with an identifier#193
Merged
Conversation
CSS Nesting 1 lets a nested rule begin with an identifier, so a prelude like h2:where(...) parses as a declaration until the block shows up. The declaration parser raised instead of returning None, so recovery dropped the rule: cascade saw 2 of typography.css's 47 blocks.
samoht
force-pushed
the
nested-rule-ident-pseudo
branch
from
July 24, 2026 03:50
1d594e6 to
203176f
Compare
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.
A nested rule whose selector starts with an identifier, such as
h2:where(:not(.x)) { ... }, was dropped with a "curly block in declaration value" warning: CSS Nesting 1 makes that prelude ambiguous with a declaration until the block appears, and the declaration parser raised rather than letting the existing nested-rule fallback run. Parsing now rewinds and retries as a rule when a block follows, so a declaration that is merely invalid still reports as one.Found against the Tailwind typography stylesheet, where cascade parsed 2 of its 47 blocks.