Focus states are important for users using a keyboard or keyboard-like input. They also need to be clearly visible for any users that have visual impairments.
In order to meet the upcoming requirements from WCAG 2.2 guidelines, we have designed clearly visible focus states that must be applied to all interactive components.
The focus states used at Vale combine both black and yellow to create a consistent but clearly visible focus state across all components, regardless of the component colour or background colour where it is placed. This consistent approach means that it is always clear which element is focused.
This page explains the two main styles used for focus states, and shows examples of how this should look across all the interactive components from the component library. For any doubts on anything that isn’t covered here, please contact the design team.
There are 2 main styles for focus states.
Text based elements
Text that can be focussed such as in-text links or the secondary button style should change to have a yellow –color-yellow background, with a 3px black box-shadow at the bottom of the element.

Buttons, cards, and similar
Shape-based components with a background such as buttons or cards use a double outline style. When focused, the element receives two box-shadow rings around it — one 3px –color-yellow and one 3px black.
Applying the focus state
Use the focus-visible pseudo-class so the ring only appears for keyboard users, not mouse clicks.
.my-button:focus-visible {
box-shadow:
0 0 0 3px var(--color-focus-ring),
0 0 0 6px var(--color-focus-contrast);
outline: none;
}