Skip to main content Skip to docs navigation

Color System

A layered color architecture — primitive scales, semantic context palettes, and body variables — that gives Chassis CSS consistent, flexible theming across light and dark modes.

Chassis CSS organizes color into three layers that build on each other. Primitive colors give every brand hue a numbered scale. Context colors map those scales onto semantic roles such as fg-main or bg-evident. Body colors alias the active context's tokens to the CSS variables components consume directly. To switch a theme or change the active context, only the active palette changes — every component picks up the new colors automatically.

Primitive colors

Primitive colors and their scale steps are defined in Chassis Tokens. By default there are seven hues — one per brand role — and any project can swap them for its own palette.

primary#00A4CC
primary-05
primary-10
primary-20
primary-30
primary-40
primary-50
primary-60
primary-70
primary-80
primary-90
primary-95
secondary#F55200
secondary-05
secondary-10
secondary-20
secondary-30
secondary-40
secondary-50
secondary-60
secondary-70
secondary-80
secondary-90
secondary-95
neutral#6F8085
neutral-05
neutral-10
neutral-20
neutral-30
neutral-40
neutral-50
neutral-60
neutral-70
neutral-80
neutral-90
neutral-95
danger#F52314
danger-05
danger-10
danger-20
danger-30
danger-40
danger-50
danger-60
danger-70
danger-80
danger-90
danger-95
success#10C263
success-05
success-10
success-20
success-30
success-40
success-50
success-60
success-70
success-80
success-90
success-95
warning#F5A300
warning-05
warning-10
warning-20
warning-30
warning-40
warning-50
warning-60
warning-70
warning-80
warning-90
warning-95
info#1414F5
info-05
info-10
info-20
info-30
info-40
info-50
info-60
info-70
info-80
info-90
info-95

Each hue has eleven scale steps: 05, 1090 in increments of ten, and 95, with 50 as the mid-point. Components and utilities never reference these scales directly — they consume them through the context layer. The scales are still exposed as CSS variables (e.g. --cx-primary-50) for cases where you need a primitive value in custom code.

Context colors

A context color is a palette of semantic tokens that adapts to light and dark mode. Chassis CSS ships with eleven: the seven brand hues — primary, secondary, neutral, success, warning, danger, info — plus four non-brand contexts: default, alternate, black, and white.

--cx-default
--cx-alternate
--cx-primary
--cx-secondary
--cx-neutral
--cx-danger
--cx-success
--cx-warning
--cx-info
--cx-black
--cx-white

Each non-brand context plays a specific role:

  • default — the standard page background and text. In dark mode it inverts automatically: light-on-dark instead of dark-on-light.
  • alternate — for prominent regions such as sidebars, banners, and callout sections. Whether it inverts in dark mode is controlled by the Chassis Tokens configuration.
  • black and white — fixed values that do not adapt to light or dark mode.

Context palettes

Each context color comes with a full palette of 36 semantic tokens grouped into nine categories — foreground, background, border, icon, link, cue, dim, and interactive (idle/hover/press/disabled). Each token maps to a CSS variable named --cx-{context}-{token}, for example --cx-primary-fg-main.

Description
Base Colors

The base color for the context and its contrast counterpart. Contrast colors are intended for design use and may not meet accessibility contrast requirements.

Foreground Colors

Text colors named by priority or function. Used for the color property. Following abstraction principles, these tokens are not limited to text — they apply to any foreground element.

Background Colors

Solid surface colors named by priority and function. Used for the background-color property.

Border Colors

Colors for borders and separator lines. Used for the border-color property.

Icon Colors

Colors for symbolic elements such as icons, list bullets, and disclosure arrows. Used for the color and fill properties.

Indicator Colors

Colors for activity indicators and selection marks. Used for the fill and accent-color properties.

Scene Colors

Semi-transparent surface colors named by function. Used for the background-color property. Suitable for overlays and layered UI surfaces.

Link Colors

Colors for anchor elements across all states. Used for the color property.

Interaction Colors

State colors for interactive elements such as buttons. Available as CSS variables only — not exposed as utility classes.

default
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
alternate
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
primary
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
secondary
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
neutral
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
danger
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
success
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
warning
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
info
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
black
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
white
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Variable Name
--cx-*-base-color
--cx-*-contrast-color
--cx-*-fg-main
--cx-*-fg-subtle
--cx-*-fg-slight
--cx-*-fg-inverse
--cx-*-fg-solid
--cx-*-fg-highlight
--cx-*-bg-main
--cx-*-bg-even
--cx-*-bg-evident
--cx-*-bg-inverse
--cx-*-bg-solid
--cx-*-bg-highlight
--cx-*-border-main
--cx-*-border-subtle
--cx-*-icon-main
--cx-*-icon-subtle
--cx-*-icon-slight
--cx-*-cue-main
--cx-*-cue-slight
--cx-*-transparent-color
--cx-*-dim-slight
--cx-*-dim-main
--cx-*-dim-subtle
--cx-*-link-main
--cx-*-link-hover
--cx-*-link-active
--cx-*-link-visited
--cx-*-fg-idle
--cx-*-bg-idle
--cx-*-fg-hover
--cx-*-bg-hover
--cx-*-fg-press
--cx-*-bg-press
--cx-*-fg-disabled
--cx-*-bg-disabled

Palette values are resolved at build time by Chassis Tokens through Tokens Studio's color processor. Each token combines a primitive color reference with an opacity value — both defined as tokens themselves — and the output arrives in CSS as a pre-computed custom property, ready to use. The example below shows the derivation pattern:

// Illustrative — derivation happens in Chassis Tokens at build time.
// Light theme.
$default-fg-main:      $black;
$default-fg-subtle:    to-opacity($default-fg-main, $opacity-fg-subtle);
$default-fg-slight:    to-opacity($default-fg-main, $opacity-fg-slight);
$default-bg-main:      $white;
$default-bg-even:      $neutral-05;
$default-bg-evident:   $neutral-10;

Body colors

The body context — default out of the box — is set in Chassis Tokens. Its palette becomes the page-level palette: the context prefix is dropped, so --cx-default-fg-main is exposed as --cx-fg-main, --cx-default-bg-main as --cx-bg-main, and so on.

From there, each palette token gets one more alias — a body semantic variable that maps directly to the CSS property it controls (for example color, background-color, or border-color):

Variable Name
--cx-fg-color
--cx-bg-color
--cx-border-color
--cx-separator-color
--cx-icon-color
--cx-bullet-color
--cx-cue-color
--cx-link-color
--cx-hover-color
--cx-active-color
--cx-visited-color
Color
 
 
 
 
 
 
 
 
 
 
 
Related Property
color
background-color
border-color
border-color
color, fill
color, fill
accent, fill
color
color (:hover)
color (:active)
color (:visited)
Default Value
--cx-fg-main
--cx-bg-main
--cx-border-main
--cx-border-subtle
--cx-icon-main
--cx-icon-subtle
--cx-cue-main
--cx-link-main
--cx-link-hover
--cx-link-active
--cx-link-visited

The .context class is how you re-aim those body variables in markup. Add class="context primary" to any element and its body variables instantly switch to the primary palette — for that element and everything inside it.

Further reading

Primitive colors, scale values, opacity levels, and context mappings are all configured in Chassis Tokens. The CSS variable names mirror the Figma variable paths in Chassis Figma — color/context/{context}/{token} in Figma becomes --cx-{context}-{token} in CSS — so designs and code always point to the same value.

For applying colors in markup, see the Colors and Background utility pages. To build context-aware components, see the Context Class page.