Repository navigation
fix(react-email): convert border radius and max width to px in pixelBasedPreset - #3846
Merged
felipefreitag merged 3 commits intoNov 13, 2026
Conversation
Contributor
|
@SwissArmyBud is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: c6b81d8 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 |
felipefreitag
approved these changes
Nov 13, 2026
commit: |
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.
Overview
This PR serves as a bug fix candidate for #3845 - currently
pixelBasedPresetis documented as the fix for Tailwind'sremunits in email clients, butrounded-*andmax-w-*still come out inrem.Technical difficulties
pixelBasedPresetonly overridestheme.extend.fontSizeandtheme.extend.spacing. Every other scale Tailwind defines inrempasses through unchanged:rounded,rounded-sm0.25rem4pxrounded-md0.375rem6pxrounded-lg0.5rem8pxmax-w-md28rem448pxmax-w-7xl80rem1280pxConsidered and rejected:
theme.borderRadiusthemselves). This works, but the preset's name and docs promise pixels, and each user has to rediscover the gap.remtopxfor every declaration. That would also change values users set deliberately, andemandcalc()cases are not a plain multiply by 16. A scale-by-scale preset keeps the change explicit and opt-out-able, since a user's ownthemestill overrides it.Each value is what the
remresolves to at a 16px root, matching how the existingspacingandfontSizescales were done.Changes
tailwind.tsx:pixelBasedPresetgains aborderRadiusscale (DEFAULT,xsto4xl) and amaxWidthscale (3xsto7xl).tailwind.spec.tsx: regression tests for the converted classes, and one that checks no class in either scale still emitsrem.patchchangeset forreact-email.Side effect worth a look:
maxWidthis Tailwind's container scale, sow-md,min-w-mdand the other container-sized widths also change fromremtopx.Not addressed:
max-w-screen-*(breakpoints,48rem) andtracking-*(em) still emitrem/em. Outlook on Windows ignoresborder-radiuswhatever the unit, so this does not give it rounded corners. I also noticedblur-smrendering asfilter:blur(var(--blur-sm))with an unresolved variable; that looks like a separate bug.Testing
tsc --noEmitandbiome checkare clean inpackages/react-email.pixelBasedPreset(for examplepackages/ui), and real email clients.Demo and evidence
A runnable before/after demo lives on a separate branch so it stays out of this PR:
aporter/2611-rem-from-pixelbasedpreset-demo.Its README walks through it:
cd packages/react-email && npx tsx demo/ab.tsxrenders the same email with and without the new scales and prints theremvalues found in each, all to local HTML for review. The branch also holds captured evidence (evidence-02.txttoevidence-07.txt: the published-package baseline, per-class output, the scan of Tailwind'sremscales, and the mutation check for the tests).Summary by cubic
Converts the
pixelBasedPreset's border radius and max width scales to pixels, sorounded-*andmax-w-*classes no longer emitrem. Previously the preset only overrodefontSizeandspacing, leaving these scales in rem values that don't render reliably in email clients.Side effects
maxWidthis Tailwind's container scale, container-sizedw-*andmin-w-*classes also switch fromremto pixels.max-w-screen-*andtracking-*still emitrem/em.react-emailandui, and a patch changeset.Written for commit c6b81d8. Summary will update on new commits.