Skip to content
Kappa
Colors
@dicehub/kappav0.4.2

Colors

54 semantic color tokens, one value per mode, consumed as CSS custom properties.

Overview

Kappa components style themselves through semantic tokens such as--kappa-control and --kappa-subtle. The theme declares every token in both modes, so light and dark are equal targets and no component carries its own palette.

The same tokens drive application surfaces, controls, status messaging, and selection states. The preview uses real Kappa controls inside two explicit mode scopes.

Lightdata-kappa-theme="light"
SyncedReadyQueuedFailed
Darkdata-kappa-theme="dark"
SyncedReadyQueuedFailed

Install and Use

Import the theme stylesheet once in your application entry point. Component imports never inject a global theme or reset, so the import stays explicit.

import "@dicehub/kappa/styles/theme-kappa.css";

Consume tokens in your own CSS alongside Kappa components.

.panel {
  border: 1px solid var(--kappa-line);
  border-radius: 0.5rem;
  background: var(--kappa-base);
  color: var(--kappa-default);
}

.panel__meta {
  color: var(--kappa-subtle);
}

Tooling and documentation read the same metadata from the public JSON export@dicehub/kappa/styles/tokens.json.

import tokens from "@dicehub/kappa/styles/tokens.json";

tokens.tokens.map((token) => token.name);

Modes

Light is the default. The canonical attribute is data-kappa-theme with the values light and dark. The legacy data-mode attribute keeps working: data-kappa-theme takes precedence over data-mode on the same element, and nested scopes override their ancestors.

<!-- Light is the default. Declare the mode on the document or on a section. -->
<html data-kappa-theme="light">

<section data-kappa-theme="dark">
  <p>Dark scope inside a light document.</p>
</section>

<!-- Compatibility: the legacy attribute keeps working. -->
<html data-mode="dark">

Scopes nest. A section with an explicit mode keeps its own values, and the theme sets a matching color-scheme so native controls and scrollbars follow.

Override tokens where your application needs its own palette. Overrides inherit down the tree, so a component scope can carry a different accent than the page.

:root {
  --kappa-accent-solid: #3b46c9;
  --kappa-accent-contrast: #ffffff;
}

.hero {
  --kappa-selected-background: #0f172a;
  --kappa-selected-contrast: #ffffff;
}

Popups follow their real DOM ancestry. A dialog or combobox popup is portaled, so it matches the element it is mounted into: theme the document root, or mount the portal inside the scope you want.

Token Reference

Every token lists its purpose, both configured values, and copy controls for the whole variable expression, the light value, and the dark value. Values that alias another token show the expression and the value it resolves to.

Surfaces

Page, panel, and control backgrounds, plus their recessed and overlay steps.

--kappa-canvas

Application page background behind every surface.

Light#fafafa
Dark#030303
--kappa-base

Base panel surface for cards, popovers, and raised regions.

Previously undefined, so components fell back to #ffffff in both modes.

Light#ffffff
Dark#0f0f0f
--kappa-control

Interactive control surface for inputs, buttons, and menus.

Light#ffffff
Dark#18181b
--kappa-tint

Recessed surface for grouped rows, tracks, and low-emphasis fills.

Light#f2f3f5
Dark#262626
--kappa-overlay

Hover and overlay fill for rows, options, and quiet controls.

Light#e9ebef
Dark#303034
--kappa-disabled-surface

Fill for disabled inputs and disabled previews.

Aliases --kappa-tint. Disabled text is exempt from contrast minimums.

Lightvar(--kappa-tint) → #f2f3f5
Darkvar(--kappa-tint) → #262626
--kappa-readonly-surface

Fill for read-only fields that stay focusable.

Aliases --kappa-tint.

Lightvar(--kappa-tint) → #f2f3f5
Darkvar(--kappa-tint) → #262626

Text

Body copy, emphasis, supporting text, and placeholders.

--kappa-default

Default body and control text.

Light#171717
Dark#f5f5f5
--kappa-strong

Highest-emphasis headings, values, and selected labels.

Previously provided by the documentation shell as --docs-strong.

Light#0a0a0a
Dark#fafafa
--kappa-subtle

Supporting text, labels, and icons.

Light value corrected from #737373 (4.27:1 on tint) to #696969 (4.95:1 on tint).

Light#696969
Dark#a1a1a1
--kappa-muted

Placeholders and inactive copy.

Aliases --kappa-subtle so placeholders move with supporting text.

Lightvar(--kappa-subtle) → #696969
Darkvar(--kappa-subtle) → #a1a1a1

Accent

The dicehub accent for links, selected indicators, and solid actions.

--kappa-accent

Accent text, links, and selected indicators.

Light#2479b6
Dark#7185ff
--kappa-accent-solid

Solid accent fill for primary actions and checked controls.

Light#247ab7
Dark#247ab7
--kappa-accent-contrast

Text and icons placed on --kappa-accent-solid.

Light#ffffff
Dark#ffffff

Selection

Selected states that pair a fill with readable contrast text.

--kappa-selected-background

Fill for selected items that invert to a strong surface.

Takes the fill role of the deprecated --kappa-selected.

Light#0a0a0a
Dark#fafafa
--kappa-selected-contrast

Text and icons placed on --kappa-selected-background.

Required whenever you keep a --kappa-selected override.

Light#ffffff
Dark#0f0f0f
--kappa-selected-text

Selected text on an unchanged surface, without a fill.

Takes the text role of the deprecated --kappa-selected.

Lightvar(--kappa-strong) → #0a0a0a
Darkvar(--kappa-strong) → #fafafa

Status

Informational, success, warning, and danger colors as text, solid fill, and tint.

--kappa-info

Informational border and indicator color.

Matches --kappa-info-solid.

Light#175cd3
Dark#175cd3
--kappa-info-text

Informational text and icons on tint or surface fills.

Light#175cd3
Dark#93c5fd
--kappa-info-solid

Solid informational fill for banners and notice actions.

Light#175cd3
Dark#175cd3
--kappa-info-tint

Informational tinted surface.

Light#dbeafe
Dark#10233f
--kappa-success

Success border and completion indicator.

Matches --kappa-success-solid; used by Input OTP completion.

Light#027a48
Dark#027a48
--kappa-success-text

Success text and icons on tint or surface fills.

Light#027a48
Dark#86efac
--kappa-success-solid

Solid success fill for confirmations and actions.

Light#027a48
Dark#027a48
--kappa-success-tint

Success tinted surface.

Light#d1fadf
Dark#102f20
--kappa-warning

Warning border and indicator color.

Matches --kappa-warning-solid.

Light#b54708
Dark#b54708
--kappa-warning-text

Warning text and icons on tint or surface fills.

Light#b54708
Dark#fde68a
--kappa-warning-solid

Solid warning fill for alerts and caution actions.

Light#b54708
Dark#b54708
--kappa-warning-tint

Warning tinted surface.

Light#fef0c7
Dark#3b2f10
--kappa-danger

Danger border and invalid-state indicator.

Matches --kappa-danger-solid in light mode; the dark indicator is raised for field borders.

Light#b42318
Dark#f87171
--kappa-danger-text

Danger text and icons on tint or surface fills.

Light#b42318
Dark#fca5a5
--kappa-danger-solid

Solid danger fill for destructive actions.

Light#b42318
Dark#b42318
--kappa-danger-tint

Danger tinted surface.

Light#fee4e2
Dark#3b1716

Charts

Ordered series colors for data visualization in light and dark themes.

--kappa-chart-1

First chart series and primary data emphasis.

Light#247ab7
Dark#8292ff
--kappa-chart-2

Second chart series.

Light#087f8c
Dark#4cc4d0
--kappa-chart-3

Third chart series.

Light#bb5a15
Dark#f4a261
--kappa-chart-4

Fourth chart series.

Light#337a4b
Dark#70c58a
--kappa-chart-5

Fifth chart series.

Light#9f3f75
Dark#e084b4
--kappa-chart-6

Sixth chart series.

Light#684bb6
Dark#a78bfa
--kappa-chart-7

Seventh chart series.

Light#ae3d39
Dark#f3837e
--kappa-chart-8

Eighth chart series.

Light#596579
Dark#aeb6c3

Borders and focus

Hairline separators, stronger boundaries, and keyboard focus rings.

--kappa-hairline

Subtle inner edge for nested separators and dividers.

Decorative boundary; not held to a contrast minimum.

Light#e7eaef
Dark#262626
--kappa-line

Standard border for controls, cards, and layout separators.

Decorative boundary; not held to a contrast minimum.

Light#e7eaef
Dark#262626
--kappa-input-border

Resting border for text inputs and field controls.

Decorative boundary; interactive hover and focus use --kappa-focus.

Light#dcdcdc
Dark#52525b
--kappa-line-strong

Decorative boundary that is stronger than the hairline: grips, keycaps, and scrollbar thumbs.

Decorative only: 1.60:1 on light controls and 2.29:1 on dark controls. When a boundary must convey essential state, use --kappa-strong or --kappa-focus, or pair it with a fill. Dark value added by the theme.

Light#c7cdd6
Dark#52525b
--kappa-focus

Focus ring color for keyboard focus.

Light#247ab7
Dark#247ab7
--kappa-focus-soft

Translucent halo behind focus rings and selected text.

20% alpha in light mode, 24% in dark mode.

Lightrgba(36, 122, 183, 0.2)
Dark#247ab73d

Supporting

Shadows, backdrops, and the compatibility values existing components require.

--kappa-shadow

Resting elevation for raised surfaces; removed in dark mode.

Light0 1px 2px rgba(16, 24, 40, 0.05)
Darknone
--kappa-popover-shadow

Elevation for popovers, menus, and floating panels.

Light0 8px 24px -6px rgba(16, 24, 40, 0.12), 0 2px 4px -2px rgba(16, 24, 40, 0.06)
Dark0 16px 40px -12px rgba(0, 0, 0, 0.72)
--kappa-emphasis

Neutral mix color for pressed overlays; not a text color.

Color mixing only; use --kappa-strong for emphasized text.

Light#17191f
Dark#17191f
--kappa-badge-beta

Beta badge outline color for the Badge component.

Aliases --kappa-accent.

Lightvar(--kappa-accent) → #2479b6
Darkvar(--kappa-accent) → #7185ff
--kappa-badge-inverted

Inverted badge fill for the Badge component.

Aliases --kappa-strong.

Lightvar(--kappa-strong) → #0a0a0a
Darkvar(--kappa-strong) → #fafafa
--kappa-badge-inverted-contrast

Inverted badge label color for the Badge component.

Aliases --kappa-base.

Lightvar(--kappa-base) → #ffffff
Darkvar(--kappa-base) → #0f0f0f
--kappa-banner-focus

Focus ring used inside Banner surfaces.

Light mode matches --kappa-focus; dark mode raises to a lighter blue on banner tints.

Light#247ab7
Dark#93c5fd

Contrast

Recommended foreground and background pairs. Text pairs hold at least 4.5:1 and non-text indicators at least 3:1, measured from unrounded luminance ratios in both modes.

Decorative boundaries such as --kappa-hairline and--kappa-line-strong, plus disabled surfaces and labels, are exempt from these minimums. When a boundary has to convey essential state, use--kappa-strong or --kappa-focus, or pair the boundary with a fill. Meeting these minimums does not certify every combination an application can build, and color alone never carries meaning: pair status and selection with labels, icons, or text.

Recommended contrast pairs for Kappa semantic tokens
PairForegroundBackgroundMinimumLightDark
Default text on canvasPrimary reading pair for page-level copy.--kappa-default--kappa-canvas4.5:117.18:118.92:1
Default text on controlsInputs, buttons, and menu labels.--kappa-default--kappa-control4.5:117.93:116.25:1
Default text on tintCopy inside recessed panels and grouped rows.--kappa-default--kappa-tint4.5:116.15:113.88:1
Strong text on baseHeadings and emphasized values on raised surfaces.--kappa-strong--kappa-base4.5:119.80:118.36:1
Supporting text on tintThe pair that set the light supporting-text value.--kappa-subtle--kappa-tint4.5:14.94:15.86:1
Supporting text on overlayLabels that sit on hover and overlay fills.--kappa-subtle--kappa-overlay4.5:14.60:15.09:1
Placeholder text on controlsPlaceholders and empty-state copy in fields.--kappa-muted--kappa-control4.5:15.49:16.86:1
Accent text on controlsLinks, selected indicators, and accent labels.--kappa-accent--kappa-control4.5:14.68:15.48:1
Text on solid accentPrimary action and checked-control label pair.--kappa-accent-contrast--kappa-accent-solid4.5:14.62:14.62:1
Text on selection fillPressed toolbar buttons and selected calendar days.--kappa-selected-contrast--kappa-selected-background4.5:119.80:118.36:1
Selected text on canvasChecked options that mark selection with text alone.--kappa-selected-text--kappa-canvas4.5:118.97:119.76:1
Info text on info tintInformational banners and status badges.--kappa-info-text--kappa-info-tint4.5:14.91:18.73:1
Success text on success tintSuccess banners and status badges.--kappa-success-text--kappa-success-tint4.5:14.76:110.32:1
Warning text on warning tintWarning banners and status badges.--kappa-warning-text--kappa-warning-tint4.5:14.78:110.54:1
Danger text on danger tintError banners, invalid fields, and status badges.--kappa-danger-text--kappa-danger-tint4.5:15.45:18.38:1
Label on solid infoNotice actions that fill with the informational solid.--kappa-accent-contrast--kappa-info-solid4.5:15.99:15.99:1
Label on solid successConfirmation actions that fill with the success solid.--kappa-accent-contrast--kappa-success-solid4.5:15.41:15.41:1
Label on solid warningCaution actions that fill with the warning solid.--kappa-accent-contrast--kappa-warning-solid4.5:15.43:15.43:1
Label on solid dangerDestructive actions that fill with the danger solid.--kappa-accent-contrast--kappa-danger-solid4.5:16.57:16.57:1
Focus ring on controlsKeyboard focus around inputs, buttons, and option rows.--kappa-focus--kappa-control3:14.62:13.83:1
Focus ring on canvasKeyboard focus on page-level surfaces.--kappa-focus--kappa-canvas3:14.43:14.46:1
Selection fill on baseSelected fill against the surface it replaces.--kappa-selected-background--kappa-base3:119.80:118.36:1
Danger indicator on controlsInvalid border and error indicator on fields.--kappa-danger--kappa-control3:16.57:16.40:1

Maintenance

packages/kappa/scripts/theme-generator/config.ts is the source of truth, with tokens, contrast pairs, and deprecations in sibling modules. The generator validates groups, modes, references, cycles, and contrast metadata, then writessrc/styles/theme-kappa.css and src/styles/tokens.json.

pnpm --filter @dicehub/kappa codegen:themes
pnpm --filter @dicehub/kappa check:themes

Theme generation runs before the library build, and the type check fails when the generated files drift from the configuration. The library build then re-verifies the packed assets with check:theme-build.

Compatibility and deprecations

  • --kappa-selected is withdrawn. Use --kappa-selected-background, --kappa-selected-contrast, --kappa-selected-text instead. Withdrawn as a global default because a single value served both selection fills and selection text. Component fallback chains still read an explicit --kappa-selected override first; set --kappa-selected-contrast beside it so the pair stays readable.

Documentation values

The previews and component pages in this site render @dicehub/kappa components. The docs shell maps its own variables to the theme and keeps documentation-only values, such as the Geist font stack, the translucent header overlay, and the shell success accent, in its own stylesheet.

This reference is one server-rendered Vue island. It marks itself withdata-markdown-keep so the Markdown export carries the complete token table, while ordinary demo islands stay out of Markdown.