Color
Color sets a variable with a light and a dark value for each surface, action, state, and status.
Summit keeps the variable names of shadcn’s base-nova style and adds success and warning. accent has a new purpose: it marks state.
Surfaces and Text
A surface variable fills an area, and its -foreground partner colors the text on it. background pairs with foreground.
| Variable | Purpose |
|---|---|
background, foreground | The page and its text |
card, card-foreground | A Card, an Alert, and an Attachment |
popover, popover-foreground | A floating surface, such as a Dialog, a Sheet, a menu, or a toast |
secondary, secondary-foreground | The secondary Button and Badge, and the highlighted row of a menu or a list |
muted | A hover fill, the track of a Slider or a Progress bar, and a Skeleton |
muted-foreground | Text that ranks below the body on any of these surfaces: a description or a placeholder |
Actions and State
primary is for actions, and accent is for state.
| Variable | Purpose |
|---|---|
primary, primary-foreground | The default Button and Badge, and the fill of a Progress bar |
accent, accent-foreground | What is on or selected: a checked Checkbox or radio, a Switch when it is on, a Slider’s range, a selected day, and a checked choice card |
ring | The focus outline, 1px on the edge of the focused control |
Lines
border divides content. input is the edge of a control.
| Variable | Purpose |
|---|---|
border | A Separator, the line under a Table row, and the edge of an outline Badge |
input | The edge of a Checkbox and a radio, the track of a Switch when it is off, the handle of the Resizable component, and the thumb of a Scroll Area. At a lower strength, the edge of a text field’s box and of an outline Button or Toggle |
Status
A status variable has no -foreground partner. It colors a tint, a dot, or an icon. destructive also colors error text.
| Variable | Purpose |
|---|---|
destructive | An error or a loss: error text, the border of an invalid field, the destructive Button and menu item, and a Badge’s tint and dot |
success | A good outcome: a Badge’s tint and dot, and the icon of an Alert or a toast |
warning | A state that needs attention: a Badge’s tint and dot, and the icon of an Alert or a toast |
Charts
chart-1 to chart-5 color the series of a chart. They are the first five colors of IBM Carbon’s categorical palette, in Carbon’s order.
Sidebar
The Sidebar has variables of its own. Its surface is sidebar, not background, and sidebar-accent is a neutral fill, unlike accent.
| Variable | Purpose |
|---|---|
sidebar, sidebar-foreground | The Sidebar’s surface and its text |
sidebar-primary, sidebar-primary-foreground | A filled mark in the Sidebar, such as the square with a workspace’s initials |
sidebar-accent, sidebar-accent-foreground | The item under the pointer and the active item |
sidebar-border | The Sidebar’s edge and its separators |
sidebar-ring | The focus outline of a control in the Sidebar |
Rules
Apply these rules when you override a class or build a surface outside the registry.
Primary and Accent
Fill an action with primary and a state with accent. A checked Checkbox next to a filled Button stays distinct because the two have different colors.
accent for a checked control and primary for the Button.primary, it matches the Button next to it, so users see the setting as a second action.Highlighted Rows
Use secondary for the row under the pointer or the arrow keys in a menu, a Select, or a Combobox. The fill moves with the pointer and doesn’t mark anything as on, so accent isn’t used.
Control Edges
A Checkbox and a radio have nothing but their edge to be found by, so keep that edge in input, which has the 3 to 1 that WCAG 2.2 SC 1.4.11 Non-text Contrast requires for the edge that identifies a control. The box of a text field has a fainter edge, below that floor.
Warning Text
warning is too light for text on a light surface. Tint with it and keep the label in foreground, as the warning Badge does.
foreground.warning, users with low vision can’t read the status.Chart Order
Use chart-1 for the first series of a Chart, chart-2 for the second, and continue in order. Carbon arranges the sequence so that each color contrasts most with its neighbors.
Raw Values
Reach a color through its variable. tokens.css sets a light and a dark value for every color variable. A hex value or a Tailwind palette color, such as bg-indigo-600, has one value, so it stays the same when the theme changes. Avoid adding a variable.
Accessibility
See Accessibility for the contrast floors for text and for a mark. The ratios in this table are computed from tokens.css, and a production build fails if a pair falls below its floor. A pair that isn’t in the table isn’t checked.
| Text or Mark | Surface | Light | Dark | Floor |
|---|---|---|---|---|
| foreground | background | Aa18.25 | Aa14.79 | 4.5 |
| card-foreground | card | Aa18.25 | Aa14.51 | 4.5 |
| popover-foreground | popover | Aa18.25 | Aa14.51 | 4.5 |
| primary-foreground | primary | Aa16.84 | Aa16.84 | 4.5 |
| secondary-foreground | secondary | Aa15.77 | Aa12.21 | 4.5 |
| muted-foreground | muted | Aa4.84 | Aa6.30 | 4.5 |
| accent-foreground | accent | Aa7.73 | Aa5.38 | 4.5 |
| sidebar-foreground | sidebar | Aa16.45 | Aa15.37 | 4.5 |
| sidebar-primary-foreground | sidebar-primary | Aa16.84 | Aa16.84 | 4.5 |
| sidebar-accent-foreground | sidebar-accent | Aa12.91 | Aa12.21 | 4.5 |
| muted-foreground | background | Aa5.37 | Aa7.63 | 4.5 |
| muted-foreground | card | Aa5.37 | Aa7.49 | 4.5 |
| muted-foreground | popover | Aa5.37 | Aa7.49 | 4.5 |
| destructive | background | Aa6.30 | Aa8.33 | 4.5 |
| success | background | Aa6.50 | Aa10.50 | 4.5 |
| chart-1 | background | 7.73 | 3.76 | 3 |
| chart-2 | background | 3.33 | 7.95 | 3 |
| chart-3 | background | 7.71 | 3.77 | 3 |
| chart-4 | background | 7.69 | 7.98 | 3 |
| chart-5 | background | 3.35 | 5.61 | 3 |
| input | background | 3.66 | 3.50 | 3 |
| ring | background | 8.38 | 5.55 | 3 |
| accent | background | 8.38 | 5.55 | 3 |
Color can’t be the only sign of a status, so a status Badge has a label, an Alert pairs its colored icon with a title, and an invalid Field shows an error message with its destructive border.
In Code
A value changes under a .dark ancestor, so a class doesn’t need a dark: variant unless its alpha differs between themes.
<section className="bg-card text-card-foreground">
<p className="text-muted-foreground">48 invoices this year.</p>
<span className="bg-success/15 dark:bg-success/25">Paid</span>
</section>Outside a class, read the variable: for a chart series, set color: 'var(--chart-1)'.
Reference
tokens.css declares these colors.
| Variable | Light | Dark |
|---|---|---|
| Surfaces | ||
| --background | oklch(1 0 0) | oklch(0.181 0.017 301.9) |
| --card | oklch(1 0 0) | oklch(0.192 0.024 295.5) |
| --popover | oklch(1 0 0) | oklch(0.192 0.024 295.5) |
| --primary | oklch(0.197 0.016 296.4) | oklch(0.973 0.018 64.9) |
| --secondary | oklch(0.95 0.006 75.4) | oklch(0.262 0.025 298.8) |
| --muted | oklch(0.964 0.003 106.4) | oklch(0.262 0.025 298.8) |
| --accent | oklch(0.44 0.18 284) | oklch(0.65 0.16 284) |
| Text | ||
| --foreground | oklch(0.197 0.016 296.4) | oklch(0.92 0.014 308.3) |
| --card-foreground | oklch(0.197 0.016 296.4) | oklch(0.92 0.014 308.3) |
| --popover-foreground | oklch(0.197 0.016 296.4) | oklch(0.92 0.014 308.3) |
| --primary-foreground | oklch(0.973 0.018 64.9) | oklch(0.197 0.016 296.4) |
| --secondary-foreground | oklch(0.197 0.016 296.4) | oklch(0.92 0.014 308.3) |
| --muted-foreground | oklch(0.528 0.026 302.6) | oklch(0.724 0.027 303.3) |
| --accent-foreground | oklch(0.973 0.018 64.9) | oklch(0.197 0.016 296.4) |
| Lines | ||
| --border | oklch(0.935 0.007 80.7) | oklch(0.262 0.025 298.8) |
| --input | oklch(0.621 0.034 302) | oklch(0.528 0.026 302.6) |
| --ring | oklch(0.44 0.18 284) | oklch(0.65 0.16 284) |
| Status | ||
| --destructive | oklch(0.51 0.175 22) | oklch(0.76 0.12 22) |
| --success | oklch(0.47 0.09 165) | oklch(0.8 0.1 165) |
| --warning | oklch(0.77 0.154 75) | oklch(0.83 0.13 76) |
| Charts | ||
| --chart-1 | oklch(0.4679 0.2189 295.08) | oklch(0.5737 0.2579 294.89) |
| --chart-2 | oklch(0.6406 0.1623 246.51) | oklch(0.7287 0.1549 241.66) |
| --chart-3 | oklch(0.4331 0.0739 194.77) | oklch(0.5324 0.0917 190.84) |
| --chart-4 | oklch(0.4649 0.1723 1.34) | oklch(0.7559 0.1672 354.52) |
| --chart-5 | oklch(0.6662 0.2088 22.13) | oklch(0.6662 0.2088 22.13) |
| Sidebar | ||
| --sidebar | oklch(0.964 0.003 106.4) | oklch(0.156 0.021 288.3) |
| --sidebar-foreground | oklch(0.197 0.016 296.4) | oklch(0.92 0.014 308.3) |
| --sidebar-primary | oklch(0.197 0.016 296.4) | oklch(0.973 0.018 64.9) |
| --sidebar-primary-foreground | oklch(0.973 0.018 64.9) | oklch(0.197 0.016 296.4) |
| --sidebar-accent | oklch(0.885 0.01 72.7) | oklch(0.262 0.025 298.8) |
| --sidebar-accent-foreground | oklch(0.197 0.016 296.4) | oklch(0.92 0.014 308.3) |
| --sidebar-border | oklch(0.935 0.007 80.7) | oklch(0.262 0.025 298.8) |
| --sidebar-ring | oklch(0.44 0.18 284) | oklch(0.65 0.16 284) |