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:Dark Mode
Implement dark mode using CSS variables: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
Use semantic color names
Use semantic color names
Define colors based on their purpose (primary, danger) rather than their appearance (blue, red).
Maintain contrast ratios
Maintain contrast ratios
Ensure text and interactive elements meet WCAG AA standards (4.5:1 for normal text).
Test in both themes
Test in both themes
If implementing dark mode, test all components in both light and dark themes.
Use relative units
Use relative units
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