feat(editor): email-safe font families in the theme
Draft
DA
5d ago+158+158+012345678901234567890123456789-13-13-01234567890123456789
Adds email-safe font families to the editor theme, as the base for a font picker in the Resend broadcast editor. resend/resend-monorepo#14764 already uses this branch's build through a pnpm patch.
What changes
EMAIL_FONTS(exported from@react-email/editor/plugins): web-safe font stacks only.- Fonts: Default (the existing system stack), Arial, Helvetica, Verdana, Tahoma, Trebuchet MS, Georgia, Times New Roman and Courier New.
- Every stack ends in a generic family.
- No web fonts are loaded, so the email makes no request to
fonts.googleapis.com.
fontFamilytheme property: it is now aKnownCssProperties/SUPPORTED_CSS_PROPERTIESselect. The basic theme's Text panel has a "Font" input onbody.- Blockquote: it no longer hardcodes its own font stack, so it follows the body font. Code stays monospace.
- Serializer: the body font is repeated on the container table, because Outlook does not inherit the
<body>font into tables. - Fix for
ThemeConfigoverrides: a{ body: { fontFamily } }override used to be added as a duplicate input in thebodygroup, where thetypographygroup's input overwrote it. The lookup now searches every group, which also fixesbody.fontSizeoverrides.
The 4 updated container.spec.tsx snapshots only gain the font-family on the container table.
Checks
vitest --project unit: 555 pass, includingfonts.spec.tsx.tsc --noEmitandbiome checkare clean.
š¤ Generated with Claude Code