Color System
The design system’s color tokens, usage guidelines, and an interactive palette preview for light and dark modes.
Color System
The @loke/design-system provides a comprehensive color system designed for accessibility, consistency, and flexibility across light and dark modes. Colors are expressed as CSS variables and primarily defined in OKLCH for better perceptual uniformity.
The interactive palette below reflects your current theme. Use the toggle to switch between light and dark and copy values in different formats (OKLCH, HEX, RGB, HSL).
Usage
The color system is implemented using CSS variables with support for both light and dark themes.
.my-element {
background-color: var(--card);
color: var(--card-foreground);
}In React components using Tailwind CSS:
<div className="bg-card text-card-foreground p-4 rounded-lg">
Card Content
</div>Color Palette
Our color system is organized into semantic categories (Base UI, Component, Sidebar, Action, Subtle UI, Data Visualization, and Brand). Explore and copy values:
Base UI Colors
Background
Main application background color.
var(--background)oklch(96% 0.04 276.98)Foreground
Primary content color, used for text and icons on the background.
var(--foreground)oklch(27.73% 0.0061 258.36)Component Colors
Card
Background color for card components.
var(--card)oklch(99.16% 0.0029 247.85)Card Foreground
Text color for content inside card components.
var(--card-foreground)oklch(37.39% 0.0822 285.49)Popover
Background color for popover elements like tooltips and dropdowns.
var(--popover)oklch(99.16% 0.0029 247.85)Popover Foreground
Text color for content inside popover components.
var(--popover-foreground)oklch(37.1% 0.0722 285.35)Sidebar Colors
Sidebar
Main background color for sidebar components.
var(--sidebar)oklch(21.03% 0.0316 264.78)Sidebar Foreground
Text color for content inside the sidebar.
var(--sidebar-foreground)oklch(95.05% 0.0041 286.32)Sidebar Accent
Used for accents and highlights within the sidebar.
var(--sidebar-accent)oklch(28.01% 0.0249 258.35)Sidebar Accent Foreground
Text color for accented elements within the sidebar.
var(--sidebar-accent-foreground)oklch(72.47% 0.1495 160.94)Sidebar Border
Used for borders and dividers within the sidebar.
var(--sidebar-border)oklch(21.03% 0.0316 264.78)Sidebar Ring
Used for focus rings and outlines within the sidebar.
var(--sidebar-ring)oklch(74.83% 0.1308 254.23)Action Colors
Primary
Used for primary actions, important UI elements, and focus states.
var(--primary)oklch(51.4% 0.2276 276.98)Primary Foreground
Text color for content inside primary elements.
var(--primary-foreground)oklch(99.17% 0.0028 325.6)Secondary
Used for secondary actions and less prominent UI elements.
var(--secondary)oklch(72.29% 0.1438 163.11)Secondary Foreground
Text color for content inside secondary elements.
var(--secondary-foreground)oklch(99.78% 0.0068 115.7)Accent
Used for accents and highlights to draw attention to specific UI elements.
var(--accent)oklch(96.71% 0.0029 264.54)Accent Foreground
Text color for content inside accented elements.
var(--accent-foreground)oklch(21.03% 0.0318 264.65)Destructive
Used for destructive actions, errors, and warnings.
var(--destructive)oklch(58.52% 0.18 24.61)Destructive Foreground
Text color for content inside destructive elements.
var(--destructive-foreground)oklch(98.48% 0.0213 193.18)Subtle UI Colors
Muted
Used for subtle backgrounds and less prominent UI elements.
var(--muted)oklch(96.71% 0.0029 264.54)Muted Foreground
Used for subtle text, placeholders, and secondary information.
var(--muted-foreground)oklch(55.13% 0.0233 264.36)Border
Used for borders, dividers, and separators.
var(--border)oklch(90.58% 0.013831 272.4947)Input
Used for input fields and form controls.
var(--input)oklch(87.53% 0.0142 268.67)Ring
Used for focus rings and outlines.
var(--ring)oklch(74.83% 0.1308 254.23)Data Visualization
Chart 1
Primary chart color for data visualization.
var(--chart-1)oklch(65.99% 0.1521 282.15)Chart 2
Secondary chart color for data visualization.
var(--chart-2)oklch(85.59% 0.0601 285.82)Chart 3
Tertiary chart color for data visualization.
var(--chart-3)oklch(72.29% 0.1438 163.11)Chart 4
Quaternary chart color for data visualization.
var(--chart-4)oklch(75.5% 0.145 230.45)Chart 5
Quinary chart color for data visualization.
var(--chart-5)oklch(68.75% 0.154 38.2)Brand Colors
Brand 50
Brand color 50
var(--brand-50)oklch(96% 0.04 276.98)Brand 100
Brand color 100
var(--brand-100)oklch(92% 0.08 276.98)Brand 200
Brand color 200
var(--brand-200)oklch(83% 0.13 276.98)Brand 300
Brand color 300
var(--brand-300)oklch(74% 0.18 276.98)Brand 400
Brand color 400
var(--brand-400)oklch(63% 0.21 276.98)Brand 500
Brand color 500
var(--brand-500)oklch(51.4% 0.2276 276.98)Brand 600
Brand color 600
var(--brand-600)oklch(42% 0.2 276.98)Brand 700
Brand color 700
var(--brand-700)oklch(33% 0.17 276.98)Brand 800
Brand color 800
var(--brand-800)oklch(24% 0.13 276.98)Brand 900
Brand color 900
var(--brand-900)oklch(15% 0.09 276.98)Brand 950
Brand color 950
var(--brand-950)oklch(5% 0.05 276.98)Color Decision Guidelines
When choosing colors for your UI:
- Use semantic colors — choose by function, not by appearance.
- Maintain contrast — ensure text and essential UI meet accessibility standards.
- Be consistent — the same meaning should use the same color systemwide.
- Consider dark mode — test both light and dark modes for each state.
Accessibility Standards
All color combinations in our system are designed to meet WCAG 2.1 AA contrast requirements where applicable. Primary CTAs and critical text aim for AAA where possible.
// Example: Emphasized action
<button className="bg-primary text-primary-foreground px-3 py-2 rounded">
Continue
</button>
// Example: Subtle content
<p className="text-muted-foreground">
This is less prominent supporting text.
</p>/* Example: Using tokens in CSS-in-JS or global CSS */
.cta {
background: var(--primary);
color: var(--primary-foreground);
}
.subtle {
color: var(--muted-foreground);
}