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

Đang mở
#3,845 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@SwissArmyBud đang làm issue này rồi.

Từ ngày 1/11/2026.

  • #3846 của @SwissArmyBud — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
tailwindcss, typescript
Lĩnh vực
cli, documentation

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
19.9k
Fork
1.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
61

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của resend/react-email

Tất cả issue của resend/react-email

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.