Skip to content

fix(tailwind): convert rgba() space syntax to comma syntax#3589

Open
yashs33244 wants to merge 1 commit into
resend:canaryfrom
yashs33244:fix/tailwind-rgba-space-syntax
Open

fix(tailwind): convert rgba() space syntax to comma syntax#3589
yashs33244 wants to merge 1 commit into
resend:canaryfrom
yashs33244:fix/tailwind-rgba-space-syntax

Conversation

@yashs33244

@yashs33244 yashs33244 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

sanitizeDeclarations normalizes modern space/slash color syntax into the comma syntax that Outlook and other legacy email clients understand, but the rgb() branch is gated on the function name only:

if (func.name === 'rgb') {  }

So a Tailwind color written as rgba(R G B / A) is never converted and survives into the inlined CSS:

rgba(255 0 128 / 0.5)   ->  rgba(255 0 128/0.5)   // unchanged, breaks in Outlook
rgb(255 0 128 / 0.5)    ->  rgb(255,0,128,0.5)    // already handled

Fix

Run the same conversion for rgba(), but only for the space/slash form. Legacy comma rgba(r, g, b, a) is left untouched, since it already renders and is more widely supported in email clients than 4-argument rgb(). Added regression cases (including one asserting legacy comma rgba() is preserved). All existing tailwind tests pass.


Summary by cubic

Convert Tailwind rgba() colors written in space/slash syntax to comma syntax during CSS sanitization so Outlook and other legacy email clients parse them correctly. Legacy comma rgba(r, g, b, a) is preserved.

  • Bug Fixes
    • Convert rgba(R G B / A) to rgb(R,G,B,A); only applies to space/slash form.
    • Added regression tests (including percentage values and legacy comma rgba() preservation).

Written for commit 0c11c63. Summary will update on new commits.

Review in cubic

sanitizeDeclarations only matched the rgb() function name, so colors
written as rgba(R G B / A) (space/slash syntax) survived into the
inlined email CSS, which Outlook and other legacy clients don't parse.
Handle rgba() the same way, but only for the space/slash form; legacy
comma rgba(r, g, b, a) is left as-is since it's already well supported.
Copilot AI review requested due to automatic review settings June 23, 2026 07:33
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown
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-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c11c63

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
react-email Patch
@react-email/editor Patch
@react-email/ui Patch

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Targeted bug fix adding rgba() conversion alongside rgb() handling. It touches a core email rendering path, so despite looking correct and tested, human review is warranted.

Re-trigger cubic

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants