Skip to content

Type to search the docs, API, and blog.

↑↓ navigate↵ openesc close
  • Zazz 0.14 alpha

    API

    Typography

    Font, text layout, and text color.

    Reach for a role first (data-ui="text-lg", native headings), then override one property with a utility. --font-weight takes a number or the role weights strong, heading, and body; standard names such as medium are not CSS, so write 500. Text color is --text, with state tiers.

    --text-wrap: truncate keeps text on one line and ends the overflow with an ellipsis. It needs a width to overflow: a block element, a sized one (--w: 48), or a flex item with --min-w: 0, since a flex item can't shrink below its content otherwise. none means plain wrapping, so --text-wrap: truncate; --text-wrap--md: none wraps from md up. It takes breakpoints and states. It beats a primitive's own overflow while active, a tier with any other value hands that back, and --overflow wins over it. The exception is --stuck: another value there changes the wrapping but keeps the clip. A multi-word value like wrap balance isn't supported. To clamp to more than one line, use --line-clamp.

    <p style="--text-wrap: truncate">A file name far too long for its column.pdf</p>

    Reference

    Typography utilities
    UtilityWritesValueTiersNotes
    --font-familyfont-familyany CSS value—
    --font-sizefont-sizeany CSS valuebreakpoints--before-font-size / --after-font-size
    --font-weightfont-weightnumber, or strong / heading / body (the role weight tokens)breakpointsKeywords: heading, body, strong; --before-font-weight / --after-font-weight
    --font-stylefont-stylekeyword—
    --leadingline-heightany CSS valuebreakpoints
    --trackingletter-spacingany CSS valuebreakpoints
    --line-clamp-webkit-line-clampline count (1 truncates)breakpoints
    --text-aligntext-alignkeywordbreakpointsworks tier-only
    --text-decorationtext-decoration-lineany CSS valuebreakpoints, statesworks tier-only
    --text-transformtext-transformkeywordbreakpoints
    --text-wraptext-wrapkeyword, plus truncate (one line, ellipsis) and none (wraps normally)breakpoints, statesworks tier-only
    --whitespacewhite-spacekeywordbreakpoints
    --textcolorany CSS valuebreakpoints, states--before-text / --after-text

    API