nest: wrap a complex parent in :is() when substituting Â
Merged
Conversation
samoht
force-pushed
the
nesting-is-wrapper
branch
from
July 24, 2026 04:22
4336f4b to
721d586
Compare
Match the ASCII convention for new prose; the section reference read "sec. 2" instead of the section-sign glyph.
CSS Nesting 1 makes & equivalent to :is() of the parent selector list. Substituting a parent that carries a combinator verbatim lets its own structure escape, so .dark & over .a .b flattened to .dark .a .b, which also requires .a to sit inside .dark.
samoht
force-pushed
the
nesting-is-wrapper
branch
from
July 24, 2026 05:18
721d586 to
255a676
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.
CSS Nesting 1 (sec. 2.1) makes
&equivalent to:is()of the parent selector list. Cascade substituted the parent verbatim, so flattening.a .b { .dark & { ... } }produced.dark .a .b, which additionally requires.ato sit inside.darkand so matches a different set of elements than.dark :is(.a .b).The wrapper is added only where it changes meaning: a parent with no combinator, or a
&heading the selector, still goes in verbatim.