feat(editor): email-safe font families in the theme

Draft
DA
5d ago
+158-13

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.
  • fontFamily theme property: it is now a KnownCssProperties / SUPPORTED_CSS_PROPERTIES select. The basic theme's Text panel has a "Font" input on body.
  • 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 ThemeConfig overrides: a { body: { fontFamily } } override used to be added as a duplicate input in the body group, where the typography group's input overwrote it. The lookup now searches every group, which also fixes body.fontSize overrides.

The 4 updated container.spec.tsx snapshots only gain the font-family on the container table.

Checks

  • vitest --project unit: 555 pass, including fonts.spec.tsx.
  • tsc --noEmit and biome check are clean.

šŸ¤– Generated with Claude Code

https://claude.ai/code/session_01ThnJ4Yz175LLQEJnjvNtzY