Skip to content
GitHub (opens in a new tab)

Theming

Semantic CSS variables. Override those tokens to change the look of the kit without rewriting component classes. The Theme panel and the Theme page share one set of controls for type, heading weight, neutrals, primary, accent, radius, shadow, and mode. They change the preview. The header keeps docs dark mode and the AI prompt.

CSS variables

Importing from agentic-ds-kit loads tokens. Components read semantic vars, not primitive ramps.

Use roles such as --surface-page, --text-primary, and --action-primary. Do not use primitive --color-* ramps in components. Foundations shows the full scale.

.page {
  background: var(--surface-page);
  color: var(--text-primary);
}

Token convention

Primitives are the source ramps. Semantics are the roles components consume.

Light values live on :root. Dark values live on [data-theme="dark"]. Brand hues overlay brand, action, focus, and link roles via [data-color]. Hex in tokens.css is generated from tokens.json — components still only see var().

Theme tokens

These families live in agentic-ds-kit/tokens.css. Override the role, not the component.

Surfaces and default text.
TokenWhat it controlsUsed by
--bg-canvas / --text-fgDefault app background and body text. --surface-page and --text-primary alias these.Page shell, body, default copy.
--bg-surface / --bg-raised / --bg-floatingWhite raised surfaces.Card, Table, Modal, Drawer.
--bg-subtle / --bg-traySubtle wells and segmented tracks.Sidebars, code wells, Tabs segmented.
--bg-field / --bg-controlInputs and resting controls.Input, Select, outline Buttons.
--surface-overlayScrim behind overlays.Modal, Drawer, AlertDialog.
Actions, focus, and borders.
TokenWhat it controlsUsed by
--action-primary / --action-on-primaryHigh-emphasis actions.Button appearance solid mode primary.
--action-primary-hover / --action-primary-pressedPrimary interaction states.Primary Button hover and press.
--action-secondaryLower-emphasis filled actions.Secondary Button, supporting UI.
--action-dangerDestructive actions.Danger Button, destructive confirms.
--focus-ring / --border-focusFocus rings and focus borders.Buttons, inputs, menus, other controls.
--border-faint / --border-strongDefault and stronger separators.Cards, tables, layout dividers.
Status roles for Badge, Alert, and Toast.
TokenWhat it controlsUsed by
--status-success / --status-success-subtle / --status-success-textSuccess fill, well, and copy.Badge, Alert, Toast.
--status-warning / --status-warning-subtle / --status-warning-textWarning fill, well, and copy.Badge, Alert, Toast.
--status-danger / --status-danger-subtle / --status-danger-textError fill, well, and copy.Badge, Alert, invalid states.
--status-info / --status-info-subtle / --status-info-textInfo fill, well, and copy.Badge, Alert, informational notices.

Dark mode

Set data-theme on the document element. The kit does not use a .dark class.

<html lang="en" data-theme="dark">
html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

Omit the attribute for light. Pair color-scheme so native controls match. This playground stores the choice in localStorage and applies it before paint.

Brand color

Nistha (Electric Blue on Slate) is the default. Ink, blue, violet, and teal ship as data-color overlays.

<html lang="en" data-color="violet">

Shortcuts: Nistha (unset), ink, blue, violet, teal. Custom writes data-color="custom" and generates primary / hover / active / subtle / focus from any hex. Dark + brand stays a light pair when the picked hex is dark. The Theme page is the live editor.

Font trio

Interface, headings, and mono are separate. The Theme controls write --font-sans, --font-display, and heading weight inside the preview.

--font-sans: var(--font-inter), system-ui, sans-serif;
--font-display: var(--font-geist-sans, "Geist"), system-ui, sans-serif;
--font-mono: var(--font-geist-mono), ui-monospace, monospace;
--type-weight-heading: 550;

Components use the trio, not per-component font cousins. Geist is the default. Heading weight is 400, 500, 550 (default, --font-weight-heading), 600, or 700 on --type-weight-heading. Copy prompt for AI includes each family, the neutral scale, spacing, and shadow intensity.

Radius scale

Semantic radius aliases a primitive scale. Change the primitive to move a whole family.

--radius-control-sm: var(--radius-50);
--radius-control-md: var(--radius-100);
--radius-control-lg: var(--radius-200);
--radius-surface-sm: var(--radius-100);
--radius-surface-md: var(--radius-100);
--radius-surface-lg: var(--radius-200);
--radius-pill: var(--radius-full);

The scale is fixed on 2 and 4px steps: xs…3xl are 2, 4, 6, 8, 12, 16, 24. Controls use --radius-control-*. Cards and dialogs use --radius-surface-*. Badges use --radius-pill. --radius-base stays 8px and does not move the scale.

Override tokens

After tokens.css loads, reassign semantic roles in your stylesheet. Point them at primitive ramps.

:root {
  --action-primary: var(--color-violet-600);
  --action-primary-hover: var(--color-violet-700);
  --action-primary-pressed: var(--color-violet-800);
  --brand-primary: var(--color-violet-600);
  --focus-ring: var(--color-violet-500);
}

[data-theme="dark"] {
  --action-primary: var(--color-violet-400);
  --action-primary-hover: var(--color-violet-300);
  --brand-primary: var(--color-violet-400);
  --focus-ring: var(--color-violet-400);
}

Prefer data-color when blue, violet, or teal is enough. For another hue, override the brand, action, and focus roles together. Do not put hex in React components. If a role is missing from the kit, stop and ask — do not add a one-off.