2 · Operable — Focus Management
Users must always know where focus is on the page.
* {
outline: none;
}
:focus-visible {
outline: 2px solid #38bdf8;
outline-offset: 3px;
border-radius: 3px;
}
Focus order must follow a logical, meaningful sequence — typically matching DOM order.
When opening a modal or dialog, move focus into it. When closing, return focus to the trigger element.
dialogEl.querySelector("[data-autofocus]").focus();