# Radius

Five steps of corner radius, from 4px on a checkbox to 12px on a drawer, and a full round for pills.

This is the rule in `dex.css` terms, for work outside the Dex codebase. Read https://brand.meetdex.ai/design.md first: it says how to set up a page and how to use the stylesheet. The page at https://brand.meetdex.ai/components/radius shows the rule on the Dex app's own React components, which only work inside the Dex codebase.

## HTML

Every `dex-` class already has its step. For anything you draw yourself, take the radius from a token:

| Token | Value | Use |
| --- | --- | --- |
| `--dex-radius-xs` | 4px | Checkboxes, key caps (`dex-checkbox`, `dex-kbd`) |
| `--dex-radius-sm` | 6px | Small buttons, menu items, calendar days |
| `--dex-radius-md` | 8px | Buttons, fields, menus, popovers, tooltips, toasts |
| `--dex-radius-lg` | 10px | Cards, dialogs, choice cards, the dropzone |
| `--dex-radius-xl` | 12px | The largest panels and drawers |
| `--dex-radius-full` | 9999px | Pills and avatars: badges, chips, switches, radios |

```html
<div class="dex-card">…</div>                                          <!-- lg, from the class -->
<div style="border-radius: var(--dex-radius-xl); background: var(--dex-card)">…</div>  <!-- your own panel -->
```

## Rules

- The radius follows the size of the thing: small marks and checkboxes `xs`, controls `md`, cards and panels `lg`, the largest panels and drawers `xl`.
- A popup takes the radius of the control that opens it. Menus, popovers and tooltips are `md`, like the buttons and fields they open from.
- `--dex-radius-full` is for pills and avatars only.
- Nothing is rounder than 12px except pills. Never write a radius in pixels; take it from a token.
