Skip to main content

Colors and opacity

Supported colors and opacity utilities.

Quick reference​

SyntaxBehavior
bg-TOKENBackground role.
text-TOKENForeground role.
border-TOKENBorder color role.
opacity-N0–100 percent opacity, integer suffix.

Example​

<Text text="A highlighted message" class="p-3 bg-accent text-on-accent opacity-100" />

Rules and validation​

Native roles include primary, secondary, disabled, background, surface, accent, on-accent, danger, on-danger, surface-disabled, separator, foreground, muted, muted-foreground, card, card-foreground, border, input, ring, accent-foreground, primary-foreground, secondary-foreground, destructive, destructive-foreground, success, on-success, and warning. ui:Theme supplies separate rc-* tokens. Native primary retains its text-color meaning. There is no arbitrary CSS color syntax.

Style lesson · Style index · Themes