Apsara uses a comprehensive CSS variable system that allows you to customize colors, spacing, typography, and more throughout your application.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/raystack/apsara/llms.txt
Use this file to discover all available pages before exploring further.
CSS variable system
The theming system is built on CSS custom properties (variables) defined in the:root selector. All variables use the -- prefix and are organized into semantic categories.
Color tokens
Apsara provides semantic color tokens that automatically adapt to light and dark themes:Typography tokens
Customize fonts and font sizes across your application:Spacing tokens
A consistent spacing scale from 2px to 120px:Border radius tokens
Control the roundness of component corners:Shadow tokens
Elevation shadows for depth and hierarchy:Customizing your theme
You can override any CSS variable to customize your theme. Create a custom CSS file and import it after the Apsara stylesheet:custom-theme.css
App.jsx
Using CSS variables in components
You can reference CSS variables directly in your custom component styles:Component-specific tokens
Many components use their own namespaced tokens. For example, buttons use:Component-specific tokens like
--rs-* variables are automatically mapped to the global tokens, but you can override them for fine-grained control.Best practices
Use semantic tokens
Use semantic tokens
Prefer semantic tokens like
--foreground-accent over direct color values. This ensures your customizations work correctly in both light and dark themes.Maintain consistent spacing
Maintain consistent spacing
Stick to the spacing scale (
--space-*) for margins, padding, and gaps to maintain visual consistency.Test in both themes
Test in both themes
Always test your customizations in both light and dark modes to ensure good contrast and readability.
Override at the right level
Override at the right level
Override global tokens in
:root for app-wide changes, or target specific components for localized customization.Related resources
Dark mode
Learn how to implement dark mode in your application
Styling
Explore different styling approaches for components