Building for keyboard first
A skip link, a visible focus ring, and a tab order that follows the page. Three things that cost almost nothing.
A site that only works with a mouse fails for the reader who navigates by keyboard, and it fails quietly, because nothing looks broken. Three habits cover most of it.

Tab order is layout order
Do not add tabindex to fix an order. Write the markup in reading order and the
tab order follows. A positive tabindex value overrides that, and the next
person to edit the page has no way to see the order you chose.
| Element | Tab reachable | Why |
|---|---|---|
| Links and buttons | Yes | Native focusable |
div with a click handler |
No | Use a button instead |
| Panel rows | Yes, roving | tabindex="0" on the active row only |

Never remove the focus ring
The browser default is ugly on a dark page, and the tempting fix is
outline: none. That removes the only signal a keyboard reader has.
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
:focus-visible draws the ring for keyboard use and leaves it off after a mouse
click, so the page stays quiet without hiding state. If a component needs a
different shape, replace the ring rather than delete it. The palette input, for
example, moves the signal to the underline of its form:
.palette-input:focus-visible {
outline: none; /* replaced by the underline on the form */
}
.palette-form:focus-within {
border-bottom-color: var(--accent-strong);
}
A skip link
The navbar is the first thing on every page, so a keyboard reader passes five links before reaching the content. A skip link moves them there in one press.
<a class="skip-link" href="#main">Skip to content</a>
.skip-link {
position: absolute;
left: -9999px;
}
.skip-link:focus {
left: var(--space-4);
top: var(--space-4);
}
It stays out of sight until it is focused, then appears over the header.
Escape closes things
Any panel that opens should close with Escape, and focus should go back to the
control that opened it. A reader who lands inside a panel and cannot leave
without hunting for a close button is trapped.
Kindness to the keyboard is not extra work. It is the work you skipped the first time.
Checking it
- Tab from the top: skip link, then five nav links, then the page.
Escapecloses the palette.- Every focus stop shows a ring you can see on black.
- Nothing is reachable only with a pointer.