fix(section): put padding media classes on td with base padding - #3699
Open
navaneethkrishnansuresh wants to merge 1 commit into
Open
fix(section): put padding media classes on td with base padding#3699navaneethkrishnansuresh wants to merge 1 commit into
navaneethkrishnansuresh wants to merge 1 commit into
Conversation
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).
Contributor
|
@navaneethkrishnansuresh is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
|
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.
Summary
Fixes media-query padding stacking on
<Section>(and the same table/tdshape on<Container>).Base padding was applied on the inner
<td>while Tailwind padding utilities (including rewritten forms likemax-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
splitPaddingStyles/splitPaddingClassNameshelpers underpackages/react-email/src/components/utils/SectionandContainerTest plan
pnpm --filter @react-email/render buildcd packages/react-email && pnpm test(321 passed)pnpm lintat repo root (exit 0; one pre-existing!importantwarning inapps/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.px-*,max-sm:px-*,max-sm_px-*) to the<td>; keep non-padding styles/classes on the outer<table>.splitPaddingStylesandsplitPaddingClassNameshelpers and use them inSectionandContainer.Written for commit e6270f3. Summary will update on new commits.