Skip to content

Type to search the docs, API, and blog.

↑↓ navigate↵ openesc close
  • Zazz 0.14 alpha

    API

    Backgrounds

    Background color, alpha, gradients, and clipping.

    --bg is the color; --bg-alpha multiplies into its alpha without touching the text. A gradient pairs a type with its stops: --bg-linear: to bottom in oklch; --bg-stops: var(--color-shade-600), transparent 20%. --bg: none clears the color and any gradient, at the base or a state.

    --bg-clip sets background-clip: border-box, padding-box, content-box, or text. With text the background shows only through the glyphs, so gradient text is --bg-linear: to right; --bg-stops: var(--color-primary), var(--color-info-foreground); --bg-clip: text; --text: transparent. It takes no tiers or states.

    Reference

    Backgrounds utilities
    UtilityWritesValueTiersNotes
    --bgbackground-colorcolor, or none (clears the color and any gradient)breakpoints, statesworks tier-only; --before-bg / --after-bg
    --bg-alphaalpha of --bg0 to 1, multiplied into --bg's alphabreakpoints, states
    --bg-linearbackground-image (linear-gradient)gradient prelude: direction, in <color-space>—
    --bg-radialbackground-image (radial-gradient)gradient prelude: shape, position, in <color-space>—
    --bg-conicbackground-image (conic-gradient)gradient prelude: from <angle>, at <position>—
    --bg-stopsthe gradient's color stopscomma-separated color stops—
    --bg-clipbackground-clipkeyword—

    API