bug(tailwind): `pixelBasedPreset` only converts spacing and font size; `rounded-*` and `max-w-*` still emit `rem`

Aperta
#3,845 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@SwissArmyBud ci sta già lavorando.

Dal 1/11/2026.

  • #3846 di @SwissArmyBud — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
tailwindcss, typescript
Ambito
cli, documentation

Direzione di ricerca

The preset is defined where pixelBasedPreset overrides theme.extend.fontSize and theme.extend.spacing; read that override first, then compare it with Tailwind's default borderRadius and maxWidth scales. Done means rounded-* and max-w-* also emit pixel values, with the demo at packages/react-email/demo/ab.tsx showing no rem left in the output. Tests should cover the new scales.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What versions are you using? (if relevant)

latest

Describe the Bug

The docs present pixelBasedPreset as the fix for Tailwind's rem units not being supported by many email clients. In [email protected] it only overrides theme.extend.fontSize and theme.extend.spacing, so other utilities that Tailwind expresses in rem still reach the inlined CSS unchanged. The docs do not say the preset is partial, so it is easy to assume everything returned is now in pixels.

What is affected (leave empty if unsure)

Tailwind Component

Link to the code that reproduces this issue

https://github.com/SwissArmyBud/react-email/tree/aporter/2611-rem-from-pixelbasedpreset-demo

To Reproduce

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.tsx renders the same email with and without the new scales and prints the rem values found in each, all to local HTML for review. The branch also holds captured evidence (evidence-02.txt to evidence-07.txt: the published-package baseline, per-class output, the scan of Tailwind's rem scales, and the mutation check for the tests) and pre-generated a/b output in the demo folder.

Expected Behavior

The docs present pixelBasedPreset as the fix for Tailwind's rem units not being supported by many email clients, so it is easy to assume everything returned is now in pixels.

What's your node version? (if relevant)

24/LTS

Lingua principale
TypeScript
Stelle
19.9k
Fork
1.1k
Merge medio
2g 15h
PR unite (30g)
61

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di resend/react-email

Tutte le issue di resend/react-email

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.