Customize the look and feel of your app with our flexible theming system.
Our platform uses a simple yet powerful theme system that provides a consistent, beautiful design for all apps. Each app has a single theme that defines its colors, typography, and visual style.
Your app's theme is defined using CSS custom properties (variables). These variables control colors, border radius, spacing, and fonts throughout your app. When you customize your theme, these variables are updated to reflect your choices.
Theme Variables: Defined in the :root section of your CSS
You can fully customize the theme to match your brand identity or design preferences. Our theme system uses HSL color values, which make it easy to create consistent color palettes and maintain visual harmony across your application.
All theme variables use HSL (Hue, Saturation, Lightness) color format, expressed as space-separated values:
--primary: 221 83% 53%;The color shade (0-360)
Color intensity (0-100%)
Brightness (0-100%)
You can import custom themes by providing CSS variables in the proper format. This makes it easy to apply themes from external sources or to reuse themes across different projects.
When importing themes, provide CSS with a :root section containing your HSL color variables:
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--primary: 221.2 83% 53.3%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96%;
--secondary-foreground: 222.2 84% 4.9%;
--muted: 210 40% 96%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96%;
--accent-foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 221.2 83% 53.3%;
--radius: 0.5rem;
/* Additional variables as needed */
}All color values must be in HSL format, expressed as space-separated values (hue, saturation, lightness) without the "hsl()" wrapper.
To make theme creation easier, you can use our recommended theme editor tool. This tool provides a visual interface for selecting colors and automatically generates the proper CSS format.
:root sectionHere are all the CSS custom properties available in our theme system. Each variable serves a specific purpose in creating a cohesive design.
| Variable | Purpose | Usage |
|---|---|---|
--background | Main page background color | Body, main containers |
--foreground | Primary text color | Headings, body text |
--card | Card background color | Cards, panels, modals |
--card-foreground | Text color on cards | Text within cards |
--popover | Popover background color | Popovers, tooltips, dropdowns |
--popover-foreground | Text color on popovers | Text within popovers |
| Variable | Purpose | Usage |
|---|---|---|
--primary | Primary brand color | Primary buttons, links, highlights |
--primary-foreground | Text color on primary elements | Text on primary buttons |
--secondary | Secondary accent color | Secondary buttons, subtle highlights |
--secondary-foreground | Text color on secondary elements | Text on secondary buttons |
--muted | Muted background color | Disabled states, subtle backgrounds |
--muted-foreground | Muted text color | Secondary text, descriptions |
--accent | Accent color for highlights | Hover states, active elements |
--accent-foreground | Text color on accent elements | Text on accent backgrounds |
--destructive | Destructive action color | Delete buttons, error states, warnings |
--destructive-foreground | Text color on destructive elements | Text on destructive buttons |
| Variable | Purpose | Usage |
|---|---|---|
--border | Border color | Dividers, card borders |
--input | Input field border color | Form inputs, text areas |
--ring | Focus ring color | Focus indicators, accessibility |
--radius | Border radius value | Rounded corners (e.g., "0.5rem") |
--spacing | Base spacing unit | Consistent spacing (e.g., "0.25rem") |
| Variable | Purpose | Usage |
|---|---|---|
--chart-1 | First chart color | Data visualization, graphs |
--chart-2 | Second chart color | Data visualization, graphs |
--chart-3 | Third chart color | Data visualization, graphs |
--chart-4 | Fourth chart color | Data visualization, graphs |
--chart-5 | Fifth chart color | Data visualization, graphs |
Sidebar-specific colors for apps with navigation sidebars.
| Variable | Purpose | Usage |
|---|---|---|
--sidebar-background | Sidebar background color | Sidebar containers |
--sidebar-foreground | Sidebar text color | Sidebar text, icons |
--sidebar-primary | Sidebar primary color | Active sidebar items |
--sidebar-primary-foreground | Text color on sidebar primary | Text on active sidebar items |
--sidebar-accent | Sidebar accent color | Hover states in sidebar |
--sidebar-accent-foreground | Text color on sidebar accent | Text on hover states |
--sidebar-border | Sidebar border color | Sidebar dividers, edges |
--sidebar-ring | Sidebar focus ring color | Focus indicators in sidebar |
| Variable | Purpose | Usage |
|---|---|---|
--font-sans | Sans-serif font family | Body text, UI elements |
--font-serif | Serif font family | Headings, decorative text |
--font-mono | Monospace font family | Code blocks, technical text |
Our theme system follows consistent naming conventions that make it intuitive to work with. Understanding these patterns will help you create harmonious themes.
Each UI element typically has a background color and a matching foreground (text) color that ensures proper contrast. For example, primary and primary-foreground are used together.
Our theme system uses semantic color variables that describe their purpose rather than their appearance. This approach ensures consistent design and makes theme switching seamless.
| Variable | Purpose |
|---|---|
background / foreground | Main page background and text colors |
card / card-foreground | Card elements and their text |
primary / primary-foreground | Primary actions, buttons, highlights |
muted / muted-foreground | Subdued elements, secondary text |