Skip to content
HHydro UIdocs
Navigate
FoundationHydro UI

Color

Semantic roles for readable, meaningful states.

Intent

Color roles are semantic, not component-specific. Components must use Layer 2 --hui-color-* aliases so an upstream design system can replace the palette without changing component CSS.

Roles

RoleTokenUse
Text--hui-color-textPrimary readable content and labels.
Muted text--hui-color-text-mutedSupporting copy and less prominent metadata.
Background--hui-color-backgroundPage/control background.
Raised background--hui-color-background-raisedCards, grouped surfaces, and elevated regions.
Link--hui-color-linkNon-button links in their default state.
Link hover/active--hui-color-link-hover, --hui-color-link-activePointer and pressed link states.
Border--hui-color-borderNeutral borders and separators.
Backdrop--hui-color-backdropModal scrim; defaults to the foreground color at 50% alpha.
Focus ring--hui-color-focus-ringKeyboard focus indicator. Never remove focus without an equivalent.
Interactive--hui-color-interactivePrimary controls and selected indicators.
Interactive hover/active--hui-color-interactive-hover, --hui-color-interactive-activePointer and pressed control states.
Interactive disabled--hui-color-interactive-disabledDisabled control foreground or indicator.
Interactive contrast--hui-color-interactive-contrastContent placed on the interactive color.
Danger--hui-color-dangerInvalid, destructive, or indeterminate messaging.
Disabled background--hui-color-disabled-backgroundDisabled control surfaces.

Accessibility rules

  • Maintain readable contrast for text and meaningful UI graphics.
  • Do not communicate state by color alone; preserve the component's state, text, or native semantics.
  • Focus must remain visible for keyboard users.
  • Use --hui-color-danger only for error or warning meaning, not as a decorative accent.

Upstream mapping

The Layer 1 palette is in tokens/base.tokens.json under ds.color.* and is emitted as --ds-color-*. Layer 2 aliases include a fallback literal, for example --hui-color-text: var(--ds-color-foreground, #0b0f14).