Skip to content

Type to search the docs, API, and blog.

↑↓ navigate↵ openesc close
Zazz 0.7 alpha
API navigation

API

Borders

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

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. Borders between direct children are the divide-x and divide-y switches, sized and colored by --divide on the container.

--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
--roundedborder-radiusany CSS value—--before-rounded / --after-rounded
--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 valuebreakpoints, states--before-border-style / --after-border-style
--divideborder between direct children (divide-x / divide-y)color, number (px), or length; set on the container—
--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