Skip to content

Token Reference

This page distinguishes the public token surfaces you should build against from the engine variables that exist for implementation, diagnostics, and advanced interop.

Most applications should prefer:

  • Semantic classes (e.g. surface-card, text-subtle, hue-brand)
  • Exported tokens (for example from axiomatic export --format typescript)

If you directly depend on --axm-* CSS variables, treat them as an advanced escape hatch rather than the default integration surface.

The primary “token surface” is the set of semantic classes generated and shipped by the system.

  • Surfaces: surface-page, surface-card, surface-action, …
  • Text: text-strong, text-subtle, …
  • Hue modifiers: hue-brand, hue-danger, …
Section titled “Exported tokens (recommended for libraries)”

If you are building custom primitives or a component library, prefer consuming exported tokens (TypeScript/DTCG/Tailwind) rather than reading engine CSS variables.

Internals / interop (engine CSS variables)

Section titled “Internals / interop (engine CSS variables)”

These variables are scoped to the current surface context (e.g., inside .surface-card) and change as nesting/context changes. They are useful for diagnostics and advanced interop, but are not the preferred day-to-day surface.

TokenDescription
--axm-surface-tokenThe background color of the current surface.
--axm-text-high-tokenHigh-contrast text color (e.g., Black on Light, White on Dark).
--axm-text-subtle-tokenLower-contrast text color for secondary information.
--axm-text-subtlest-tokenLowest-contrast text color for placeholders or disabled text.
--axm-border-dec-tokenDecorative border color (low contrast).
--axm-border-int-tokenInteractive border color (higher contrast).

Prefer using the utility classes (like .text-strong, .surface-card) instead of accessing these tokens directly. This ensures your UI remains consistent with the system’s composition model.

These utility classes provide a semantic layer over the raw tokens.

These utilities allow elements to “read” the current surface context and apply it to specific properties. Use these when you need an element to match the current surface (e.g., for masking or blending) without creating a new surface context.

ClassDescription
.bg-surfaceSets background-color to the surface token.
.border-surfaceSets border-color to the surface token.
.stroke-surfaceSets SVG stroke to the surface token.

These utilities apply system-wide interaction styles, ensuring consistency for focus and selection states.

ClassDescription
.ring-focusApplies a static focus ring.
.ring-focus-visibleApplies a focus ring only on :focus-visible.
.border-highlightSets border-color to the highlight ring color.

You can compose surface classes with hue utilities to create colored surfaces.

<!-- A button with the highlight color -->
<button class="surface-action hue-highlight">Click Me</button>

These tokens are defined on :root and are available everywhere.

TokenDescription
--axm-shadow-smSmall shadow for subtle depth.
--axm-shadow-mdMedium shadow for cards and dropdowns.
--axm-shadow-lgLarge shadow for modals and floating actions.
--axm-shadow-xlExtra large shadow for major overlays.
TokenDescription
--axm-focus-ring-colorThe brand-aware color used for focus rings.

If you have configured a palette in color-config.json, these tokens will be available.

TokenDescription
--axm-chart-1First color in the categorical palette.
--axm-chart-2Second color…
--axm-chart-NNth color.

You may see these tokens in the generated CSS, but they are generally intended for internal use by the engine.

  • --axm-chroma-brand: The base chroma value derived from your key colors.
  • --axm-hue-brand: The base hue value derived from your key colors.