Skip to documentation content

Colors

Use Honest UI's semantic foreground, background, border, overlay, and visualization color tokens across light and dark themes.

Honest UI names colors by purpose. Components ask for a primary foreground, an accent background, or a danger border; the theme then resolves that role to an appropriate value. This keeps the code understandable and lets light, dark, accent, and neutral palettes change without renaming component classes.

Use the --hui-color-* tokens on this page in application and component code. The lower-level --hui-neutral-*, --hui-accent-*, --hui-danger-*, --hui-attention-*, and --hui-success-* scales feed these roles and are intended for building the theme itself.

Foreground colors

Foreground tokens are for text, icons, and other content placed over a background.

Honest UI foreground color tokens
PreviewTokenValueUse
--hui-color-foreground-base-primaryTheme-awareHeadings, labels, and primary content
--hui-color-foreground-base-secondaryTheme-awareSupporting copy and secondary icons
--hui-color-foreground-base-tertiaryTheme-awareMuted metadata and placeholder text
--hui-color-foreground-base-emphasisTheme-awareHigh-contrast content on a neutral emphasis background
--hui-color-foreground-accent-primaryTheme-awareAccent links and interactive content
--hui-color-foreground-accent-primary-hoverTheme-awareHover state for accent foreground content
--hui-color-foreground-accent-emphasisTheme-awareContent on an accent emphasis background
--hui-color-foreground-attention-primaryTheme-awareWarning and attention content
--hui-color-foreground-attention-primary-hoverTheme-awareHover state for attention foreground content
--hui-color-foreground-attention-emphasisTheme-awareContent on an attention emphasis background
--hui-color-foreground-danger-primaryTheme-awareError messages and destructive actions
--hui-color-foreground-danger-primary-hoverTheme-awareHover state for danger foreground content
--hui-color-foreground-danger-emphasisTheme-awareContent on a danger emphasis background
--hui-color-foreground-success-primaryTheme-awareSuccess and positive-state content
--hui-color-foreground-success-primary-hoverTheme-awareHover state for success foreground content
--hui-color-foreground-success-emphasisTheme-awareContent on a success emphasis background

Background colors

Background tokens define page surfaces, containers, selection states, and semantic emphasis.

Honest UI background color tokens
PreviewTokenValueUse
--hui-color-background-base-primaryTheme-awareMain page and component surface
--hui-color-background-base-primary-hoverTheme-awareHover state on a base surface
--hui-color-background-base-secondaryTheme-awareSecondary page, card, or panel surface
--hui-color-background-neutral-primaryTheme-awareSubtle neutral highlight
--hui-color-background-neutral-secondaryTheme-awareNeutral control and grouped-content surface
--hui-color-background-neutral-secondary-hoverTheme-awareHover state for a neutral secondary surface
--hui-color-background-neutral-tertiaryTheme-awareStrong neutral surface
--hui-color-background-neutral-tertiary-hoverTheme-awareHover state for a strong neutral surface
--hui-color-background-neutral-emphasisTheme-awareHighest-contrast neutral surface
--hui-color-background-accent-primaryTheme-awareSubtle accent highlight or selection
--hui-color-background-accent-emphasisTheme-awareAccent-filled control or prominent state
--hui-color-background-accent-emphasis-hoverTheme-awareHover state for accent emphasis
--hui-color-background-attention-primaryTheme-awareSubtle warning or attention surface
--hui-color-background-attention-emphasisTheme-awareStrong attention surface
--hui-color-background-attention-emphasis-hoverTheme-awareHover state for attention emphasis
--hui-color-background-danger-primaryTheme-awareSubtle error or destructive surface
--hui-color-background-danger-emphasisTheme-awareDestructive filled control or strong error state
--hui-color-background-danger-emphasis-hoverTheme-awareHover state for danger emphasis
--hui-color-background-success-primaryTheme-awareSubtle success surface
--hui-color-background-success-emphasisTheme-awareStrong success surface
--hui-color-background-success-emphasis-hoverTheme-awareHover state for success emphasis

Border colors

Border tokens define separators, control boundaries, focus treatment, and semantic states.

Honest UI border color tokens
PreviewTokenValueUse
--hui-color-border-base-primaryTheme-awareSubtle boundaries and separators
--hui-color-border-base-secondaryTheme-awareClearer dividers and control boundaries
--hui-color-border-base-tertiaryTheme-awareStrong base border for inputs and cards
--hui-color-border-base-tertiary-hoverTheme-awareHover treatment for a strong base border
--hui-color-border-base-focusTheme-awareNeutral focus or active boundary
--hui-color-border-base-emphasisTheme-awareHighest-contrast neutral border
--hui-color-border-accent-primaryTheme-awareSubtle accent boundary
--hui-color-border-accent-emphasisTheme-awareStrong accent and default focus boundary
--hui-color-border-accent-emphasis-hoverTheme-awareHover state for accent emphasis borders
--hui-color-border-attention-primaryTheme-awareSubtle warning boundary
--hui-color-border-attention-emphasisTheme-awareStrong warning boundary
--hui-color-border-attention-emphasis-hoverTheme-awareHover state for attention emphasis borders
--hui-color-border-danger-primaryTheme-awareSubtle error or invalid boundary
--hui-color-border-danger-emphasisTheme-awareStrong danger boundary
--hui-color-border-danger-emphasis-hoverTheme-awareHover state for danger emphasis borders
--hui-color-border-success-primaryTheme-awareSubtle success boundary
--hui-color-border-success-emphasisTheme-awareStrong success boundary
--hui-color-border-success-emphasis-hoverTheme-awareHover state for success emphasis borders

Overlay colors

Overlay scales provide 12 opacity steps. base follows the active theme—black in light mode and white in dark mode. The black and white scales keep their hue fixed, which is useful for media scrims and effects whose direction must not change with the theme.

Honest UI overlay color tokens
PreviewTokenValueUse
--hui-color-overlay-base-a1Theme-awareTheme-aware overlay at 5% opacity
--hui-color-overlay-base-a2Theme-awareTheme-aware overlay at 10% opacity
--hui-color-overlay-base-a3Theme-awareTheme-aware overlay at 15% opacity
--hui-color-overlay-base-a4Theme-awareTheme-aware overlay at 20% opacity
--hui-color-overlay-base-a5Theme-awareTheme-aware overlay at 30% opacity
--hui-color-overlay-base-a6Theme-awareTheme-aware overlay at 40% opacity
--hui-color-overlay-base-a7Theme-awareTheme-aware overlay at 50% opacity
--hui-color-overlay-base-a8Theme-awareTheme-aware overlay at 60% opacity
--hui-color-overlay-base-a9Theme-awareTheme-aware overlay at 70% opacity
--hui-color-overlay-base-a10Theme-awareTheme-aware overlay at 80% opacity
--hui-color-overlay-base-a11Theme-awareTheme-aware overlay at 90% opacity
--hui-color-overlay-base-a12Theme-awareTheme-aware overlay at 95% opacity
--hui-color-overlay-black-a1black, 5% opacityBlack overlay at 5% opacity
--hui-color-overlay-black-a2black, 10% opacityBlack overlay at 10% opacity
--hui-color-overlay-black-a3black, 15% opacityBlack overlay at 15% opacity
--hui-color-overlay-black-a4black, 20% opacityBlack overlay at 20% opacity
--hui-color-overlay-black-a5black, 30% opacityBlack overlay at 30% opacity
--hui-color-overlay-black-a6black, 40% opacityBlack overlay at 40% opacity
--hui-color-overlay-black-a7black, 50% opacityBlack overlay at 50% opacity
--hui-color-overlay-black-a8black, 60% opacityBlack overlay at 60% opacity
--hui-color-overlay-black-a9black, 70% opacityBlack overlay at 70% opacity
--hui-color-overlay-black-a10black, 80% opacityBlack overlay at 80% opacity
--hui-color-overlay-black-a11black, 90% opacityBlack overlay at 90% opacity
--hui-color-overlay-black-a12black, 95% opacityBlack overlay at 95% opacity
--hui-color-overlay-white-a1white, 5% opacityWhite overlay at 5% opacity
--hui-color-overlay-white-a2white, 10% opacityWhite overlay at 10% opacity
--hui-color-overlay-white-a3white, 15% opacityWhite overlay at 15% opacity
--hui-color-overlay-white-a4white, 20% opacityWhite overlay at 20% opacity
--hui-color-overlay-white-a5white, 30% opacityWhite overlay at 30% opacity
--hui-color-overlay-white-a6white, 40% opacityWhite overlay at 40% opacity
--hui-color-overlay-white-a7white, 50% opacityWhite overlay at 50% opacity
--hui-color-overlay-white-a8white, 60% opacityWhite overlay at 60% opacity
--hui-color-overlay-white-a9white, 70% opacityWhite overlay at 70% opacity
--hui-color-overlay-white-a10white, 80% opacityWhite overlay at 80% opacity
--hui-color-overlay-white-a11white, 90% opacityWhite overlay at 90% opacity
--hui-color-overlay-white-a12white, 95% opacityWhite overlay at 95% opacity

Choose the lightest step that still communicates the layer and preserves contrast for content above and below it. An overlay does not replace dialog semantics, focus management, or an accessible name.

Visualization colors

Four steps are available in each of 14 visualization families. Step 6 is the lightest supplied value, 8 provides more separation, 9 is the main solid color, and 11 is suited to stronger foreground use. Their exact appearance changes between light and dark themes.

Honest UI visualization color tokens
PreviewTokenValueUse
--hui-color-viz-sky-6Theme-awareSky visualization family, step 6
--hui-color-viz-sky-8Theme-awareSky visualization family, step 8
--hui-color-viz-sky-9Theme-awareSky visualization family, step 9
--hui-color-viz-sky-11Theme-awareSky visualization family, step 11
--hui-color-viz-mint-6Theme-awareMint visualization family, step 6
--hui-color-viz-mint-8Theme-awareMint visualization family, step 8
--hui-color-viz-mint-9Theme-awareMint visualization family, step 9
--hui-color-viz-mint-11Theme-awareMint visualization family, step 11
--hui-color-viz-lime-6Theme-awareLime visualization family, step 6
--hui-color-viz-lime-8Theme-awareLime visualization family, step 8
--hui-color-viz-lime-9Theme-awareLime visualization family, step 9
--hui-color-viz-lime-11Theme-awareLime visualization family, step 11
--hui-color-viz-grass-6Theme-awareGrass visualization family, step 6
--hui-color-viz-grass-8Theme-awareGrass visualization family, step 8
--hui-color-viz-grass-9Theme-awareGrass visualization family, step 9
--hui-color-viz-grass-11Theme-awareGrass visualization family, step 11
--hui-color-viz-green-6Theme-awareGreen visualization family, step 6
--hui-color-viz-green-8Theme-awareGreen visualization family, step 8
--hui-color-viz-green-9Theme-awareGreen visualization family, step 9
--hui-color-viz-green-11Theme-awareGreen visualization family, step 11
--hui-color-viz-jade-6Theme-awareJade visualization family, step 6
--hui-color-viz-jade-8Theme-awareJade visualization family, step 8
--hui-color-viz-jade-9Theme-awareJade visualization family, step 9
--hui-color-viz-jade-11Theme-awareJade visualization family, step 11
--hui-color-viz-cyan-6Theme-awareCyan visualization family, step 6
--hui-color-viz-cyan-8Theme-awareCyan visualization family, step 8
--hui-color-viz-cyan-9Theme-awareCyan visualization family, step 9
--hui-color-viz-cyan-11Theme-awareCyan visualization family, step 11
--hui-color-viz-blue-6Theme-awareBlue visualization family, step 6
--hui-color-viz-blue-8Theme-awareBlue visualization family, step 8
--hui-color-viz-blue-9Theme-awareBlue visualization family, step 9
--hui-color-viz-blue-11Theme-awareBlue visualization family, step 11
--hui-color-viz-iris-6Theme-awareIris visualization family, step 6
--hui-color-viz-iris-8Theme-awareIris visualization family, step 8
--hui-color-viz-iris-9Theme-awareIris visualization family, step 9
--hui-color-viz-iris-11Theme-awareIris visualization family, step 11
--hui-color-viz-purple-6Theme-awarePurple visualization family, step 6
--hui-color-viz-purple-8Theme-awarePurple visualization family, step 8
--hui-color-viz-purple-9Theme-awarePurple visualization family, step 9
--hui-color-viz-purple-11Theme-awarePurple visualization family, step 11
--hui-color-viz-pink-6Theme-awarePink visualization family, step 6
--hui-color-viz-pink-8Theme-awarePink visualization family, step 8
--hui-color-viz-pink-9Theme-awarePink visualization family, step 9
--hui-color-viz-pink-11Theme-awarePink visualization family, step 11
--hui-color-viz-crimson-6Theme-awareCrimson visualization family, step 6
--hui-color-viz-crimson-8Theme-awareCrimson visualization family, step 8
--hui-color-viz-crimson-9Theme-awareCrimson visualization family, step 9
--hui-color-viz-crimson-11Theme-awareCrimson visualization family, step 11
--hui-color-viz-orange-6Theme-awareOrange visualization family, step 6
--hui-color-viz-orange-8Theme-awareOrange visualization family, step 8
--hui-color-viz-orange-9Theme-awareOrange visualization family, step 9
--hui-color-viz-orange-11Theme-awareOrange visualization family, step 11
--hui-color-viz-gold-6Theme-awareGold visualization family, step 6
--hui-color-viz-gold-8Theme-awareGold visualization family, step 8
--hui-color-viz-gold-9Theme-awareGold visualization family, step 9
--hui-color-viz-gold-11Theme-awareGold visualization family, step 11

Visualization colors are not a promise that every pair has sufficient contrast or is distinguishable for every form of color vision. Label series directly where possible, keep a stable series-to-color mapping, and add shapes, line styles, patterns, or text when color would otherwise carry the meaning alone. See Chart configuration for chart-specific color setup.

Change the palette

Indigo and gray are the defaults provided by data-theme. Set optional palette attributes on the same element to switch the accent or neutral source values:

<html
  data-theme="dark"
  data-style="modern"
  data-accent-color="orange"
  data-gray-color="slate"
>

Supported accent overrides are orange and mint. Supported neutral choices are gray, mauve, slate, and sage. An unsupported value does not create a fallback palette; use one of the documented values or define the complete source scale yourself.

Tailwind usage

Map each product state to complete, static class strings so Tailwind can detect them at build time:

const statusClass = {
  success:
    "border-[var(--hui-color-border-success-primary)] bg-[var(--hui-color-background-success-primary)] text-[var(--hui-color-foreground-success-primary)]",
  warning:
    "border-[var(--hui-color-border-attention-primary)] bg-[var(--hui-color-background-attention-primary)] text-[var(--hui-color-foreground-attention-primary)]",
  error:
    "border-[var(--hui-color-border-danger-primary)] bg-[var(--hui-color-background-danger-primary)] text-[var(--hui-color-foreground-danger-primary)]",
} as const

export function Status({ status, children }) {
  return (
    <span
      className={`rounded-[var(--hui-radius-full)] border px-[var(--hui-space-3)] py-[var(--hui-space-1)] ${statusClass[status]}`}
    >
      {children}
    </span>
  )
}

Do not interpolate a token fragment into a class name. Tailwind must see the complete class string in source. Read Tailwind CSS for typed shorthand and optional aliases.

Color checks before release

  • Pair emphasis backgrounds with the matching emphasis foreground token. Mint intentionally resolves to dark accent-contrast text, while indigo and orange resolve to light text.
  • Keep default, hover, active, focus, disabled, invalid, warning, success, and destructive states distinct in both themes.
  • Check WCAG contrast with the rendered color pair. A semantic name describes intent; it does not prove contrast in every custom combination.
  • Never rely on color alone for status, validation, selection, or chart meaning. Add text, icons, patterns, or another persistent cue.
  • Verify forced-colors mode and avoid overriding system colors when doing so would hide native accessibility behavior.
  • Prefer semantic tokens over raw OKLCH values in component code. Override the palette or semantic role in one owned location when the whole product needs to change.