Skip to main content

CSS Custom Properties

The library uses CSS custom properties (CSS variables) for theming. Override these variables to customize the appearance:

Custom Theme Example

Create a custom theme by overriding variables:
Import your theme after the library styles:

Dark Mode

Implement dark mode using CSS variables:
Toggle dark mode in your app:

Component-Specific Styling

Override styles for specific components:

Scoped Theming

Apply different themes to different parts of your app:

Available Variables

Colors

Typography

Spacing

Borders

Best Practices

Define colors based on their purpose (primary, danger) rather than their appearance (blue, red).
Ensure text and interactive elements meet WCAG AA standards (4.5:1 for normal text).
If implementing dark mode, test all components in both light and dark themes.
Use rem/em for spacing and sizing to support user font size preferences.

Examples

Storybook Themes

See themed components in action

CSS Variables Reference

Complete variable reference