stylesheet: drop bang comments written inside a rule - #1276
Merged
Merged
Conversation
A /*! */ comment in a value, a selector, an at-rule prelude or a block is hoisted out as a statement in front of the rule, so the @tailwindcss/forms output diffs against an equivalent sheet as two removed rules.
The bang-comment scan read the whole source and placed every comment that started before a rule's end in front of that rule, and a token's location began at the comments before it, so a comment inside a rule could not be told from one just before it. A token's location now starts after its leading comments, and only a comment before the next rule is kept as a statement; one inside a rule is discarded with the rule's other comments.
samoht
force-pushed
the
bang-comment-in-rule
branch
from
September 23, 2026 09:09
1fa7841 to
5c6dfa7
Compare
samoht
added this pull request to stack #1278
September 23, 2026 09:09
mseri
pushed a commit
to ocaml/opam-repository
that referenced
this pull request
Sep 24, 2026
CHANGES: ### Parsing - A `/*! */` comment inside a rule is discarded with the rule's other comments instead of being hoisted out in front of it, so `cascade diff` no longer reports removed rules on `@tailwindcss/forms` output (samoht/cascade#1276).
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
/*! */comment inside a rule was hoisted out as a statement in front of it, socascade diff --diff=canonicalreported removed rules on thevar(--tw-empty,/*!*/ /*!*/)that@tailwindcss/formsemits. It is now discarded with the rule's other comments; a/*!inside an@mediablock is dropped too rather than moved before the block.