fix(tailwind): stop emitting a bare nested rule for group/peer markers#3594
Open
yashs33244 wants to merge 1 commit into
Open
fix(tailwind): stop emitting a bare nested rule for group/peer markers#3594yashs33244 wants to merge 1 commit into
yashs33244 wants to merge 1 commit into
Conversation
extractRulesPerClass walked into nested rules and collected class names from the whole block, so group/peer markers (referenced via :where(.group) inside a group-* utility's nested rule) were keyed to a duplicate, parentless &:is(...) rule emitted into the <style> block. Skip rules whose prelude is a nesting selector and collect class names from the prelude only.
Contributor
|
@yashs33244 is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 863cd98 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Fixes a CSS extraction bug that emitted malformed rules for group/peer markers. Change is isolated to a utility function, includes a regression test, and all existing tests pass.
Re-trigger cubic
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.
What
Using a
group/peermarker class together with agroup-*/peer-*variant injects a duplicate, malformed rule into the<head><style>:extractRulesPerClassproduces two non-inlinable entries:The second is invalid CSS in a
<style>block (the&has no parent). It happens because the rule walker descends into the variant's nested&:is(:where(.group):hover *)rule and processes it standalone, and because class names are collected from the whole rule block - so the.groupreference inside:where(.group)keys the marker class.Fix
In
extractRulesPerClass:&…) - they belong to a parent utility, not a standalone class;rule.preludeonly, so a class referenced inside the block doesn't key the rule.Now only
group-hover:underlineis emitted; thegroupmarker produces nothing. Added a regression test; all tailwind tests pass.Summary by cubic
Stops emitting the duplicate, malformed parentless
&:is(...)rule whengroup/peermarkers are used withgroup-*/peer-*variants inreact-email. This prevents invalid CSS in the<head>and keeps only the correct utility rules.extractRulesPerClass, skip rules whose first selector is a nesting selector (&...) and collect class names fromrule.preludeonly to avoid keying marker classes.groupwithgroup-hover:underline.Written for commit 863cd98. Summary will update on new commits.