Foundations
Color
Coffee brown and olive green on warm neutrals, in light and dark. Every color is defined once in tokens.json and reaches the screen through three layers.
Why we chose this
Brown is the brand and the one main action. Olive supports it. Warm neutrals carry the page. Every color has a role name (surface-primary-default), not a value, and both themes use the same names, so a component never needs to know which theme is on.
Use it for
- The main action of a view:
surface-primary-defaultwithstatic-whitetext - Supporting actions and calm links: the
secondaryolive tokens - Success, warning, error and info: only to report a status
Don't
- Type a hex value or a primitive like
brown-500in a component. Use the role token. - Put two primary buttons in one view.
- Let color be the only signal. Add text or an icon.
Which color for which job
Pick by the job, never by the look. These are the tokens you will use most. The swatches follow the active theme, so flip the theme in the header to see both.
| Token | Use it for |
|---|---|
surface-page | The page ground. Everything else sits on it. |
surface-component | Cards, menus, dialogs and fields, one step above the page. |
surface-tint | A warm layer to group a section or a panel without a shadow. |
surface-primary-default | The one main action of a view. Its label is static-white. |
surface-secondary-default | Supporting actions next to a primary one. |
text-base-default | Body text and headings. |
text-base-neutral | Secondary text: hints, captions, meta. |
text-primary-default | Brand accents and brand-colored text. |
text-secondary-default | Calm links inside paragraphs. |
border-light | Dividers and the default border of cards and fields. |
border-strong | Borders that must be seen: inputs, outlined buttons. |
focus-primary | The keyboard focus ring. Always visible, never removed. |
surface-error-default | Errors: fill. Pair with text-state-error for messages. |
text-state-success | Success messages. Warning and info have their own -state- tokens. |
All 94 semantic tokens, with their light and dark values, are in the token reference.
The three-layer structure
Colors reach the screen in three steps. Think of a paint shop. The cans of paint are the raw colors. The labels on them say what each can is for: walls, trim, doors. The rooms are what people actually see. A room always asks for "wall paint", never for "can number 500". So when you repaint, you change what is inside the wall can once, and every wall follows.
See it work: one role, two themes
The role surface-secondary-default means "the fill of a supporting button". In light it points to one green, in dark to a slightly lighter one. The button only knows the role, so it switches by itself.
The three layers
| 1 · Raw colors (primitives) | 2 · Roles (semantic tokens) | 3 · Components | |
|---|---|---|---|
| In plain words | The paint cans. Every shade we own, named by hue and darkness. | The labels on the cans: what each color is for. | What people see, built from labels, never from cans. |
| Example | brown-500 is #a75e2a | surface-primary-default | .cm-btn--primary |
| Changes with the theme? | No. A raw color is always the same. | Yes. Each role picks a raw color for light and another for dark. | No. Components never know which theme is on. |
| Who edits it | Design system owners, rarely. | Design system owners, when a role is missing or a value changes. | Anyone building screens. |
| Where it lives | tokens.json, primitives | tokens.json, semantic | components.css and your own code |
| Use it in your code? | Never | Always | You use the components themselves |
What do I change when…
| You want to | Change this layer | What happens |
|---|---|---|
| Fix a color that looks wrong in dark mode | 2 · Roles: point the role to another raw color for dark | Every component using that role updates. No component code changes. |
| Rebrand to a different brown | 1 · Raw colors: change the brown steps | Every role that points to brown follows, and so does every component. |
| Make one button look different | 3 · Component: use another role, for example the secondary one | Only that component changes. |
| Use "a slightly lighter brown" for something new | 2 · Roles: add a role that says what it is for | The new need gets a name, so it can be reused and works in both themes. |
Follow one token through the layers
Pick any role to see which raw color it uses in each theme, and how a component writes it.
Rules
| Rule | Reason |
|---|---|
| Components use semantic tokens only. Never a primitive, never a hex. | Otherwise theming and rebrands break. |
| Pick by role, not by look. If "a lighter brown" is what you want, the role is missing: add a semantic token. | Keeps the system small and meaningful. |
| Only the semantic layer may reference primitives. | One place to change what a role means. |
| Every semantic token needs a light and a dark value. | No screen should be left with a color from the other theme. |
Today the component layer consumes semantic tokens directly. If we later need per-component overrides (for example button-primary-bg), they would be added here as a thin layer that points to semantic tokens.
The palette
Two brand hues keep the identity simple. Coffee brown is the primary: main actions, brand accents, warm backgrounds. Olive green is the secondary: supporting actions, links and quiet elements. Greys, red, yellow, green and blue exist for text, borders and status messages (see Status colors) so the brand hues are never overloaded.
Primary · Brown
Secondary · Moss (olive green)
Olive has the same 12 steps as brown, so a future role (a hover tint, a dark surface, a divider) never has to borrow a color from another hue.
Step numbers are not equal across ramps. moss-500 is about as dark as brown-600. Choose by role, never by matching step numbers.
Supporting ramps
Light and dark
The same token names exist in both themes. Only their values change. Components never know which theme is active, so dark mode needs no component code. Dark is a designed theme, not an inversion: surfaces go to near-black, brand colors get lighter so they keep their contrast, and warm tints become deep browns.
Same components, two themes
How the themes differ
Switching
<html data-theme="dark"> <!-- or "light" (default) -->
// follow the system setting
const dark = matchMedia("(prefers-color-scheme: dark)").matches;
document.documentElement.dataset.theme = dark ? "dark" : "light";
You can also set data-theme on any wrapper to preview one theme inside another, as the panels above do.
Interactive states
Primary and secondary actions share one set of states. Each has a -default, -hover, -pressed, -focused and -disabled token.
Hover and pressed get progressively darker (lighter in dark mode) to feel physical. Do not use the *-focused fills for keyboard focus: keep the default fill and show focus with the focus-primary ring, which is visible on every surface.
Status colors
Alerts, form controls and messages use four status colors: red for error, yellow for warning, green for success and blue for information. They were chosen to sit next to coffee brown and olive green without being mistaken for them.
Our two brand hues are warm: brown sits at about 53° and olive at 130°. A standard orange "warning" (about 50°) and a standard green "success" (about 145°) landed almost on top of them, so a warning looked like the primary brand color and success looked like the secondary button. We moved each status hue to its own space on the wheel: red 22° (crimson, away from brown), yellow 85° (golden, between brown and olive), green 162° (emerald, cooler than olive) and blue 243° (the only cool hue, unchanged). Each step keeps the same contrast as before, so nothing needed re-auditing.
Alerts
Form controls
| Status | Surface | Text | Icon | Border |
|---|---|---|---|---|
| Error | surface-error-invert | text-state-error | icon-error | border-error-default |
| Warning | surface-warning-invert | text-state-warning | icon-warning | border-warning |
| Success | surface-success-invert | text-state-success | icon-success | border-success |
| Information | surface-information-invert | text-state-information | icon-information | border-information |
Never use the brand brown or olive to mean a status. A solid status fill (surface-*-default) takes white text, except warning, which takes text-on-warning (dark).
Contrast
Text must reach 4.5:1 (WCAG AA) against the surface it sits on. Ratios below are computed live from the token values.
Pair text with its listed surface: text-base-default on surface-page, text-on-warning on surface-warning-default.
.notice {
background: var(--surface-warning-default);
color: var(--text-on-warning);
}Put white text on yellow or light blue fills, or use text-primary-default for body copy. The usage line of each token says where it is safe.
.notice {
background: var(--surface-warning-default);
color: var(--static-white);
}Accessibility
Color is only one way of saying something. These are the guarantees built into the tokens, so teams don't have to re-check them.
- Contrast is audited. Every text role lists the surfaces it is safe on. Body text meets AA (4.5:1), most reach AAA (7:1). Control borders meet 3:1.
- Color never works alone. Status is always a color plus an icon plus a word.
- Focus is always visible. One ring (
focus-primary) works on every surface, in light and dark. - Both themes are checked. Dark values are chosen for contrast, not just inverted.
- Status colors stay distinct from each other and from the brand, including for common color-blindness (simulate below).
- Disabled is exempt but labelled. Disabled text has its own token and is also dimmed by shape, not by color alone.
Rating tags
The contrast table uses these tags:
Never color alone
Icon, bold word and message. Still clear in greyscale.
<p class="error" role="alert">
<svg aria-hidden="true">…</svg>
<b>Payment failed.</b>
Check your card number and try again.
</p>
.error { color: var(--text-state-error); }Payment
Red text alone. Someone who can't tell red from brown, or a screen reader, gets no message.
<p style="color: red">Payment</p>
Focus ring
Press Tab to move through these. The ring is the same on every control.
Color-blindness simulator
Switch the view and check that the four statuses and the two brand colors can still be told apart. This is an approximation.
Checklist before shipping a screen
- Text uses a
text-*token on a surface its usage line lists. - Every status shows an icon and a word, not just a color.
- Keyboard focus is visible on every control.
- The screen was checked in light and dark.
- Greyscale preview still shows the hierarchy.
Semantic token reference
Every role, its CSS variable and what it is for. Filter by category or search.
Each swatch shows the light value on the left and the dark value on the right. Click a name to copy it.
Naming and use
| Pattern | Example | Meaning |
|---|---|---|
<ramp>-<step> | brown-500 | Primitive. Higher number is darker. |
<property>-<role>-<state> | surface-primary-hover | Semantic. Property (surface, text, icon, border), role, then state. |
.card { background: var(--surface-component); color: var(--text-base-default);
border: 1px solid var(--border-light); }
.card:hover { background: var(--surface-tint); }
background: var(--surface-primary-default)
.cta {
background: var(--surface-primary-default);
color: var(--static-white);
}
.card {
background: var(--surface-component);
border: 1px solid var(--border-light);
}background: #a75e2a or var(--brown-500) in a component.
.cta {
background: #a75e2a;
color: #fff;
}
.card {
background: var(--white-100);
border: 1px solid var(--grey-200);
}