# Borders

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

Source: https://www.zazz.sh/api/utilities/borders/

`--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.

```html
<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

| Utility | Writes | Value | Tiers | Notes |
| --- | --- | --- | --- | --- |
| `--radius` | `border-radius` | number (× --spacing × --radius-multiplier), length, or full | breakpoints, states | keywords: `full`; works tier-only; `--before-radius` / `--after-radius` |
| `--radius-t` | `border-start-start-radius, border-start-end-radius` | number, length, or full: the two block-start corners | breakpoints | keywords: `full`; works tier-only |
| `--radius-b` | `border-end-start-radius, border-end-end-radius` | number, length, or full: the two block-end corners | breakpoints | keywords: `full`; works tier-only |
| `--radius-l` | `border-start-start-radius, border-end-start-radius` | number, length, or full: the two inline-start corners | breakpoints | keywords: `full`; works tier-only |
| `--radius-r` | `border-start-end-radius, border-end-end-radius` | number, length, or full: the two inline-end corners | breakpoints | keywords: `full`; works tier-only |
| `--corner-shape` | `corner-shape` | round, squircle, bevel, or any corner-shape value | — |  |
| `--border` | `border-width + border-color` | color (1px solid), number (px wide, --color-border), or length | breakpoints, states |  |
| `--border-x` | `border-inline width + color` | color, number (px), or length | breakpoints, states |  |
| `--border-y` | `border-block width + color` | color, number (px), or length | breakpoints, states |  |
| `--border-t` | `border-block-start width + color` | color, number (px), or length | breakpoints, states |  |
| `--border-r` | `border-inline-end width + color` | color, number (px), or length | breakpoints, states |  |
| `--border-b` | `border-block-end width + color` | color, number (px), or length | breakpoints, states |  |
| `--border-l` | `border-inline-start width + color` | color, number (px), or length | breakpoints, states |  |
| `--border-width` | `border-width` | any CSS value | breakpoints, states | `--before-border-width` / `--after-border-width` |
| `--border-color` | `border-color` | any CSS value | breakpoints, states | `--before-border-color` / `--after-border-color` |
| `--border-style` | `border-style` | any CSS value | states | `--before-border-style` / `--after-border-style` |
| `--divide` | `a border between direct children, on both axes` | color, number (px), length, or none; set on the container | breakpoints |  |
| `--divide-x` | `a border between direct children, on the inline axis` | color, number (px), length, or none; beats --divide | breakpoints |  |
| `--divide-y` | `a border between direct children, on the block axis` | color, number (px), length, or none; beats --divide | breakpoints |  |
| `--outline` | `outline` | any CSS value | — | `--before-outline` / `--after-outline` |
| `--ring` | `box-shadow (ring width)` | number (px) or length; negative draws it inset | breakpoints, states |  |
| `--ring-color` | `box-shadow (ring color)` | any CSS value | breakpoints, states | works tier-only |
| `--ring-offset` | `box-shadow (ring offset width)` | number (px) or length | breakpoints, states |  |
| `--ring-offset-color` | `box-shadow (ring offset color)` | any CSS value | breakpoints, states | works tier-only |
| `--focus-ring` | `a primitive's focus ring and the focus outline (width, inside or out)` | number (px) or length; negative draws it inset (default --ring-width) | breakpoints |  |
