Theming
Theming lets you customize the visual appearance of your components using design tokens and design system principles.
What is Theming?
Theming allows you to:
- Define design tokens — Colors, typography, spacing, shadows
- Create theme variants — Light mode, dark mode, brand variants
- Apply globally — Automatically apply to all components
- Override locally — Allow components to customize their appearance
Creating a Theme
Step 1: Start a New Theme
- Click Theming in the sidebar
- Click New Theme
- Name your theme (e.g., "Dark Mode", "Brand v2.0")
- Choose a base theme to start from (Light, Dark, or blank)
- Click Create
Step 2: Define Design Tokens
Configure your design tokens:
Colors
- Primary — Main brand color
- Secondary — Accent color
- Success — Positive actions
- Warning — Caution/warning states
- Danger — Destructive actions
- Background — Page/surface backgrounds
- Text — Text colors (primary, secondary, muted)
- Border — Border colors
Typography
- Font Family — Default font(s)
- Base Size — Default text size (usually 16px)
- Line Height — Default line height
- Letter Spacing — Default letter spacing
- Font Weights — Available weights (400, 500, 600, 700, etc.)
Sizing
- Spacing Scale — Base unit (usually 4px or 8px)
- Border Radius — Default corner radius
- Shadows — Shadow definitions
- Breakpoints — Responsive breakpoints
Spacing
- Padding Scale — Padding increments
- Margin Scale — Margin increments
- Gap Scale — Gap between elements
Step 3: Preview Changes
See how your theme looks:
- Click Preview
- View components with your new theme applied
- Adjust colors/tokens as needed
- Click Save when satisfied
Theme Management
Switching Themes
To apply a theme to your organization:
- Click Theming
- Find the theme you want to use
- Click Set as Default
- All components use this theme by default
Users can also switch themes individually in their Settings.
Creating Theme Variants
Create multiple themes for different contexts:
- Open a theme
- Click New Variant
- Name it (e.g., "Dark Mode", "Accessibility")
- Modify the tokens for this variant
- Click Save
Exporting Themes
Export themes for use in other projects:
-
Open the theme
-
Click Export
-
Choose format:
- CSS Variables — Ready to use in CSS
- JSON — For programmatic access
- Design Tokens — W3C design tokens format
- Figma — Import into Figma
-
Download or copy
Using Themes in Components
Applying Theme Tokens
In your component code, use theme variables:
function Button({ children }) {
return (
<button style={{
backgroundColor: 'var(--color-primary)',
color: 'var(--color-primary-text)',
padding: 'var(--spacing-2)',
borderRadius: 'var(--radius-md)',
fontFamily: 'var(--font-family)',
}}>
{children}
</button>
);
}
Theme-Aware Variants
Create component variants for different themes:
- Open the component
- Click Variants
- Create variants for each theme:
- Light variant
- Dark variant
- Configure appearance for each
Accessibility in Theming
Color Contrast
Ensure sufficient color contrast:
- Text on background: minimum 4.5:1 ratio
- Large text: minimum 3:1 ratio
- Interactive elements: minimum 3:1 ratio
Click Check Contrast to verify your theme.
High Contrast Mode
Create a high-contrast theme variant for accessibility:
- Open your theme
- Click New Variant
- Name it "High Contrast"
- Increase color contrasts
- Adjust borders and spacing for clarity
Dark Mode
Create a dark theme variant:
- Create a new theme or variant
- Name it "Dark"
- Set dark background colors
- Adjust text colors for readability
- Apply to all components
Users can toggle between light and dark modes in their preferences.
Sharing Themes
Share themes with your team:
- Open the theme
- Click Share
- Choose sharing level:
- Private — Only you
- Team — Your team
- Organization — Everyone
- Click Share
Theme Versioning
Track theme changes:
- Make updates to a theme
- Click Save as Version
- Add a changelog note
- Previous versions are archived
- Roll back to previous versions if needed