fix(react-email/tailwind): enhance CSS rule extraction and inline style handling#2949
Open
Shubhdeep12 wants to merge 3 commits intoresend:canaryfrom
Open
fix(react-email/tailwind): enhance CSS rule extraction and inline style handling#2949Shubhdeep12 wants to merge 3 commits intoresend:canaryfrom
Shubhdeep12 wants to merge 3 commits intoresend:canaryfrom
Conversation
…ling - Updated `extractRulesPerClass` to split mixed rules into inlinable and non-inlinable parts. - Added a new test case to verify the correct extraction of mixed rules. - Modified the `cloneElementWithInlinedStyles` function to handle residual classes more effectively. - Adjusted inline snapshots in tests for consistency with new style handling.
🦋 Changeset detectedLatest commit: f1dcdbc 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 |
|
@Shubhdeep12 is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
Contributor
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 4/5
- Potential duplication in
packages/tailwind/src/utils/css/split-mixed-rule.tswhen non-inlinable rules with only inlinable children fall back to a full clone could lead to repeated declarations alongside the inlinable part - Overall risk seems limited given the low confidence in the report and the single moderate issue, so this PR looks safe to merge with care
- Pay close attention to
packages/tailwind/src/utils/css/split-mixed-rule.ts- possible declaration duplication in split logic.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/tailwind/src/utils/css/split-mixed-rule.ts">
<violation number="1" location="packages/tailwind/src/utils/css/split-mixed-rule.ts:49">
P2: When a non-inlinable rule has only inlinable children, nonInlinablePart falls back to the full clone, duplicating all declarations alongside inlinablePart.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Updated string quotes from single to double for consistency. - Enhanced documentation for non-inlinable parts to clarify behavior when no split occurs. - Ensured non-inlinable part always returns a valid structure with an empty block when necessary.
…le extraction - Updated `extractRulesPerClass` to only set non-inlinable rules if a valid part exists. - Modified `splitMixedRule` to return null for non-inlinable parts when none are present, enhancing clarity in the function's behavior.
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.
related #2909
Summary by cubic
Inline base declarations from mixed Tailwind rules and keep only media/pseudo parts in the stylesheet. This fixes missing inline styles and preserves responsive behavior in @react-email/tailwind.
Written for commit f1dcdbc. Summary will update on new commits.