Skip to content

Design tokens / Opacity

Opacity ​

Opacity levels for states and overlays, defined in packages/pixel/tokens/opacity.css.

TokenValueSample
--opacity-level-semiopaque0.72
--opacity-level-intense0.64
--opacity-level-medium0.32
--opacity-level-light0.16
--opacity-level-semitransparent0.08

What they're for ​

Overlay states: a backdrop behind a modal, a subtle hover over a surface, a disabled control.

css
.backdrop {
  background: var(--color-pure-black);
  opacity: var(--opacity-level-intense);
}

What they're not for ​

Never use opacity to dim legible text. Fading text below full opacity lowers its contrast against the background in a way that's invisible to a contrast checker reading the declared color — the computed result can drop under the 4.5:1 minimum while the CSS still says --color-master-dark.

When text should recede, pick a lighter step of the master ramp instead. The token is honest about the resulting color, and it stays correct in dark mode, where the ramp inverts and opacity does not.

?> No kuba component uses these tokens today. Disabled inputs, for one, change their background and text color rather than fading — precisely to keep the contrast readable. They're here for the product you build on top.