Email Theme
FoundationResolves shadcn HSL design tokens into email-safe concrete hex values. Generates Tailwind config for React Email with pixelBasedPreset-compatible settings. The bridge between your shadcn theme and email rendering.
core/email-themeInstallation
1 · Add registry to components.json
2 · Install component
Examples
Resolved tokens
The default Keystone Core email theme: HSL tokens resolved to hex, with typography and border-radius.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
EmailThemeTokens | interface | — | Fully resolved token set: all colors as #rrggbb, font stacks, border radii as px strings. |
hslToHex(hsl) | string → string | — | Converts "220 14% 94%" to "#eeeff1". |
resolveEmailTheme(hslTokens, overrides?) | EmailThemeTokens | — | Resolves HSL record into concrete tokens, with optional overrides. |
createEmailTailwindConfig(theme) | EmailTailwindConfig | — | Generates Tailwind config with colors, fonts, and radii from resolved tokens. |
KC_DEFAULT_HSL_TOKENS | Record<string, string> | — | Keystone Core light-mode HSL tokens from globals.css. |