Skip to content

fix(section): put padding media classes on td with base padding - #3699

Open
navaneethkrishnansuresh wants to merge 1 commit into
resend:canaryfrom
navaneethkrishnansuresh:fix/3693-section-media-padding
Open

fix(section): put padding media classes on td with base padding#3699
navaneethkrishnansuresh wants to merge 1 commit into
resend:canaryfrom
navaneethkrishnansuresh:fix/3693-section-media-padding

Conversation

@navaneethkrishnansuresh

@navaneethkrishnansuresh navaneethkrishnansuresh commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Fixes media-query padding stacking on <Section> (and the same table/td shape on <Container>).

Base padding was applied on the inner <td> while Tailwind padding utilities (including rewritten forms like max-sm_px-5) landed on the outer <table>. In email CSS those paddings stack instead of the media query replacing the base padding.

This routes padding styles and padding class utilities (including max-sm:px-* / max-sm_px-*) onto the same <td> as base padding, and keeps non-padding styles/classes on the outer <table>.

Fixes #3693

Changes

  • Add splitPaddingStyles / splitPaddingClassNames helpers under packages/react-email/src/components/utils/
  • Use them in Section and Container
  • Unit tests for the helpers + regression cases on Section/Container

Test plan

  • pnpm --filter @react-email/render build
  • cd packages/react-email && pnpm test (321 passed)
  • pnpm lint at repo root (exit 0; one pre-existing !important warning in apps/web, unrelated)

Summary by cubic

Fixes padding stacking in <Section> and <Container> by moving responsive Tailwind padding classes and inline padding styles onto the inner <td>. Media-query padding now correctly overrides base padding in email clients like Outlook and Klaviyo.

  • Bug Fixes
    • Route padding styles and utilities (e.g., px-*, max-sm:px-*, max-sm_px-*) to the <td>; keep non-padding styles/classes on the outer <table>.
    • Add splitPaddingStyles and splitPaddingClassNames helpers and use them in Section and Container.
    • Add unit tests for the helpers and regression tests for both components.

Written for commit e6270f3. Summary will update on new commits.

Review in cubic

Route padding styles and Tailwind padding utilities (including
max-sm:px-* / max-sm_px-*) onto the inner td for Section and
Container so media-query padding overrides base padding instead of
stacking (fixes resend#3693).
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@navaneethkrishnansuresh 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 Aug 6, 2026

Copy link
Copy Markdown

鈿狅笍 No Changeset found

Latest commit: e6270f3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Aug 7, 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.

<Section>: tailwind media query padding does not replace the base padding

1 participant