States
Interactive states shift one step on the 12-step color scale instead of using opacity hacks. Layering uses six named z-index tokens from base (0) to toast (50).
Interactive state rules
| State | Step / rule | Static chip |
|---|---|---|
| Solid (default → hover → pressed) | step 9 → 10 → 11 | 9 default10 hover11 pressed |
| Subtle (default → hover → pressed) | step 3 → 4 → 5 | 3 default4 hover5 pressed |
| Selected | 2px border or step-shifted fill | selected (2px) |
| Disabled | step 3 background, step 8 text (no opacity) | disabled (3/8) |
| Focus ring | 2px width, 2px offset, var(--ring) (:focus-visible) | focus ring |
Keyboard focus sample
Tab to this control to inspect the 2px focus ring with 2px offset.
Keep disabled controls at step 3 background and step 8 text with full 1 opacity. Render focus rings on :focus-visible only so pointer clicks stay clean while keyboard focus remains unmistakable.
Z-index layering
| Layer | Tailwind | CSS var | Value | Use |
|---|---|---|---|---|
| base | z-base | --z-base | 0 | Default document flow |
| sticky | z-sticky | --z-sticky | 10 | Sticky headers, top bars, sidebars |
| dropdown | z-dropdown | --z-dropdown | 20 | Menus, select popups, comboboxes |
| overlay | z-overlay | --z-overlay | 30 | Backdrop dimmers and grid overlays |
| modal | z-modal | --z-modal | 40 | Dialogs, sheets, alert modals |
| toast | z-toast | --z-toast | 50 | Transient status notifications |
Default Tailwind numeric z-* classes are blocked in theme.css so every overlay and popup uses a named layer token.
Usage
Apply state and layering tokens in Tailwind CSS or CSS:
<div className="relative z-dropdown rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-lg">
<button
type="button"
className="w-full rounded-sm px-3 py-2 text-left text-body transition-colors duration-100 ease-standard hover:bg-muted"
>
Menu action
</button>
</div>.interactive-control:focus-visible {
outline: var(--focus-ring-width) solid var(--focus-ring-color);
outline-offset: var(--focus-ring-offset);
}
.modal-layer {
z-index: var(--z-modal);
}Do and don't
Accessibility
- Global
:focus-visiblestyling renders a2pxsolid--ringoutline with a2pxoffset so keyboard navigation works on every interactive element. - Disabled controls use step 3 background and step 8 text without opacity reduction, keeping state styling predictable across themes.
Rationale
Step-shifting states preserve calibrated surface separation in both dark and light modes, and six named z-index tiers prevent stacking-context wars.