Repository navigation
Conversation
jasikpark
marked this pull request as ready for review
October 28, 2026 21:17
jasikpark
requested review from
johnmaguire
and removed request for
johnmaguire
October 28, 2026 21:18
johnmaguire
previously approved these changes
Oct 29, 2026
johnmaguire
left a comment
Member
There was a problem hiding this comment.
LGTM, one small inline note.
Non-blocking: @namespace has the same top-level-only rule and is still wrapped in the layer (invalid there). It could be one more line in the same filter, or a follow-up under #11 if you'd rather keep this PR narrow.
@namespace is only valid at the top level, so wrapping it in the layer invalidated it. A hoisted @charset kept its raws.before, so a leading comment in the source left a newline ahead of it and browsers ignored it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
First slice of #11.
The plugin wraps every root node in the layer, which breaks two kinds of rule that only work at the top level of a stylesheet:
@charsethas to be the first statement in the file.:importand:exportat the root, so values exported from a CSS Module (e.g. Sass design tokens) silently disappear once they're inside@layer.These are now hoisted ahead of the layer wrapper. Neither emits styles, so moving them doesn't change the cascade, and files without them produce identical output.
Not in this PR (each its own follow-up from #11):
@import: moving it outside the layer would make the imported CSS unlayered (higher priority than every layer), so it should become@import "x" layer(<name>)instead.layerOrderoption.