Overview
RendererOptions is a configuration object passed to the Renderer constructor to customize how emails are rendered.
Type Definition
Properties
Tailwind CSS configuration object (v3) to extend or override the default theme.The
TailwindConfig type is Omit<Config, 'content'> - a standard Tailwind config without the content property.Example:Custom CSS to inject into email rendering (e.g., app theme variables).This CSS is injected during Tailwind compilation, making variables and styles available for processing. This is particularly useful for:Example with CSS variables:
- Maintaining consistent styling between your app and emails
- Sharing theme variables (e.g., shadcn-svelte theme variables)
- Defining CSS custom properties with
@property - Adding global styles that should apply to all emails
Base font size in pixels for converting relative units (rem, em) to absolute pixels.This value is used when resolving
calc() expressions with mixed units during style inlining.Important: In the email rendering context, em is treated as rem (relative to this base font size) since parent element context is not available during the rendering process.Example:Usage Examples
Minimal configuration
With Tailwind configuration only
With custom CSS only
With custom base font size
Complete configuration
Using with shadcn-svelte theme
Using CSS @property for variable resolution
Backward Compatibility
TheRenderer constructor also accepts a bare TailwindConfig object for backward compatibility:
The constructor automatically detects which API you’re using. If the object contains
tailwindConfig, customCSS, or baseFontSize properties, it’s treated as RendererOptions. Otherwise, it’s treated as a legacy TailwindConfig.See Also
- Renderer - The Renderer class
- RenderOptions - Options for the render() method