Theming
The Fanfare SDK supports extensive theming through CSS custom properties and a theme configuration object.CSS Custom Properties
Widgets use CSS custom properties (variables) for styling:Theme Configuration
Pass a theme configuration object when initializing:ExperienceTheme Interface
Widget Variants
Widgets support different visual variants:| Variant | Description |
|---|---|
default | Standard appearance |
rounded | More rounded corners, softer appearance |
retro | Vintage/retro styling |
clean | Minimal, flat design |
Dark Mode
Support dark mode with CSS:ThemeProvider (React)
Use the ThemeProvider for React component trees:Nested Themes
Themes can be nested for section-specific styling:Experience-Level Theming
Themes can be configured per-experience in the Fanfare dashboard. The SDK automatically applies these when usinguseExperienceJourney:
Brand Color Examples
Scoped Styling
Scope styles to specific widgets:Best Practices
- Use CSS variables for easy theme switching
- Test both light and dark modes
- Ensure sufficient contrast for accessibility
- Keep consistent with your brand guidelines
- Test on multiple screen sizes