Skip to content

Type to search the docs, API, and blog.

↑↓ navigate↵ openesc close
  • Zazz 0.14 alpha

    API

    Borders

    Radius, borders, dividers, outline, and the focus ring.

    --radius is on the spacing scale: a number is that many --spacing steps times --radius-multiplier, so --radius: 2.5 is --radius-md. A length passes through (--radius: 1rem) and full is a pill. It takes states and breakpoints (--radius: 1; --radius--hover: 4). --radius-t, --radius-b, --radius-l, and --radius-r round two corners each and follow the writing direction, so --radius-t: 2.5 rounds a card's media along the top; they take breakpoints and win over --radius.

    Every radius utility picks up --radius-corner-shape, except --radius: full, which stays round. --corner-shape overrides the shape on one element: --corner-shape: bevel. It takes no states or breakpoints, and on a primitive it reaches the root element only.

    The border shorthands sort one value into width and color: a color is a 1px solid border in that color, a number is that many pixels in --color-border, a length is the width in --color-border. The all-sides longhands (--border-width, --border-color, --border-style) win over a shorthand.

    --divide-x and --divide-y go on a container and draw a border between its direct children; --divide draws both axes. They take the same grammar as --border, plus none, and breakpoint tiers. There are no width, color, or style longhands. An axis beats --divide, and nested containers keep their own dividers.

    <ul style="--divide-y: 1">…</ul>
    <div style="--display: flex; --divide-x: var(--color-primary)">…</div>

    A child's border utilities override the divider, so --border-b: 0 clears one. Avoid --border: none for this: under the border grammar it draws a transparent 1px on every side, which hides the divider but still takes up space. --divide: 1 on a single flex row draws a bottom border too, so use --divide-x there.

    --ring draws a ring as a box-shadow, so it never moves layout: a number is pixels, a length passes through, and a negative width draws it inset (--ring: -2). It takes breakpoint and state tiers, so --ring: 2; --ring--md: -2 flips it inside from md up. --ring-offset adds a gap in --ring-offset-color.

    A primitive's focus ring is separate: it reads the --ring-width token, and --focus-ring overrides it per element with the same signed width. --focus-ring: -2 keeps the ring inside the box (and its forced-colors outline with it), which keeps focus visible in a container that clips its overflow; on a plain link or element it sets the focus outline. It takes breakpoint tiers (--focus-ring--md: 3), and below a tier set alone the default ring stays.

    Reference

    Borders utilities
    UtilityWritesValueTiersNotes
    --radiusborder-radiusnumber (× --spacing × --radius-multiplier), length, or fullbreakpoints, statesKeywords: full; works tier-only; --before-radius / --after-radius
    --radius-tborder-start-start-radius, border-start-end-radiusnumber, length, or full: the two block-start cornersbreakpointsKeywords: full; works tier-only
    --radius-bborder-end-start-radius, border-end-end-radiusnumber, length, or full: the two block-end cornersbreakpointsKeywords: full; works tier-only
    --radius-lborder-start-start-radius, border-end-start-radiusnumber, length, or full: the two inline-start cornersbreakpointsKeywords: full; works tier-only
    --radius-rborder-start-end-radius, border-end-end-radiusnumber, length, or full: the two inline-end cornersbreakpointsKeywords: full; works tier-only
    --corner-shapecorner-shaperound, squircle, bevel, or any corner-shape value—
    --borderborder-width + border-colorcolor (1px solid), number (px wide, --color-border), or lengthbreakpoints, states
    --border-xborder-inline width + colorcolor, number (px), or lengthbreakpoints, states
    --border-yborder-block width + colorcolor, number (px), or lengthbreakpoints, states
    --border-tborder-block-start width + colorcolor, number (px), or lengthbreakpoints, states
    --border-rborder-inline-end width + colorcolor, number (px), or lengthbreakpoints, states
    --border-bborder-block-end width + colorcolor, number (px), or lengthbreakpoints, states
    --border-lborder-inline-start width + colorcolor, number (px), or lengthbreakpoints, states
    --border-widthborder-widthany CSS valuebreakpoints, states--before-border-width / --after-border-width
    --border-colorborder-colorany CSS valuebreakpoints, states--before-border-color / --after-border-color
    --border-styleborder-styleany CSS valuestates--before-border-style / --after-border-style
    --dividea border between direct children, on both axescolor, number (px), length, or none; set on the containerbreakpoints
    --divide-xa border between direct children, on the inline axiscolor, number (px), length, or none; beats --dividebreakpoints
    --divide-ya border between direct children, on the block axiscolor, number (px), length, or none; beats --dividebreakpoints
    --outlineoutlineany CSS value—--before-outline / --after-outline
    --ringbox-shadow (ring width)number (px) or length; negative draws it insetbreakpoints, states
    --ring-colorbox-shadow (ring color)any CSS valuebreakpoints, statesworks tier-only
    --ring-offsetbox-shadow (ring offset width)number (px) or lengthbreakpoints, states
    --ring-offset-colorbox-shadow (ring offset color)any CSS valuebreakpoints, statesworks tier-only
    --focus-ringa primitive's focus ring and the focus outline (width, inside or out)number (px) or length; negative draws it inset (default --ring-width)breakpoints

    API