Skip to content

fix(tailwind): route Section padding to the inner td#3592

Open
yashs33244 wants to merge 1 commit into
resend:canaryfrom
yashs33244:fix/tailwind-section-padding-td
Open

fix(tailwind): route Section padding to the inner td#3592
yashs33244 wants to merge 1 commit into
resend:canaryfrom
yashs33244:fix/tailwind-section-padding-td

Conversation

@yashs33244

@yashs33244 yashs33244 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

Section splits its style so that padding goes to the inner <td> and everything else to the outer <table> - this is the Outlook/Klaviyo compatibility split. But when padding is set through a Tailwind class instead of style, it lands on the <table> and the <td> is bare:

<Tailwind><Section className="bg-white p-4">x</Section></Tailwind>
// -> <table style="background-color:…;padding:1rem"><tbody><tr><td>x</td>…

Section is missing from componentsToTreatAsElements, so isComponent(Section) is true. The Tailwind walker therefore renders Section with its className still attached, which Section spreads onto the <table>, and then inlines every utility onto that plain <table> - bypassing the <td> split. Container (which has the same split) is already in the list.

Fix

Add Section to componentsToTreatAsElements so its Tailwind styles are inlined onto its style prop, letting the existing split route padding to the <td>:

// -> <table style="background-color:…"><tbody><tr><td style="padding:1rem">x</td>…

Two lines (import + array entry), matching Container. Added a regression test; all tailwind/section/container/row/column tests pass.


Summary by cubic

Fix Tailwind padding on Section so utilities like p-4 apply to the inner <td>, not the outer <table>, restoring Outlook/Klaviyo compatibility. Matches existing style-prop behavior and aligns Section with Container.

  • Bug Fixes
    • Treat Section as an element in the Tailwind walker to inline utilities into style, letting the padding split route to the <td>.
    • Added a regression test for <Section className="bg-white p-4">.

Written for commit 12ec10f. Summary will update on new commits.

Review in cubic

Section was not in componentsToTreatAsElements, so the Tailwind walker
left its className on the rendered <table> and inlined every utility
onto that table, bypassing Section's own padding-to-<td> split. Treat
Section like Container so padding utilities reach the <td> (Outlook/
Klaviyo compatibility), the same as style-prop padding already does.
Copilot AI review requested due to automatic review settings June 23, 2026 07:53
@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.

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.

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 12ec10f

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

@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.

Auto-approved: Small fix adding Section to the Tailwind element list so padding utilities route to the inner , matching Container's behavior. Includes a regression test and changeset. No business logic, infrastructure, or security impact.

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