If you navigate with a keyboard, you need to see which control has focus. Removing a browser’s default outline without replacing it makes links and other controls harder to use. The CSS :focus-visible pseudo-class lets a browser show a custom focus indicator when it deems one useful—for instance, after keyboard navigation—rather than styling every focused state with :focus. section 5.3.1 section 5.4
*:focus-visible {
/* Inner focus indicator */
outline: 3px solid #F9F9F9;
outline-offset: 0;
/* Outer focus indicator */
box-shadow: 0 0 0 5px #193146;
}
This rule gives focused elements a light, 3px inner outline and a dark outer shadow. The two colors help the indicator stand out on both light and dark backgrounds, including image links. section 5.4
TIP: Test the whole page
Navigate with Tab and Shift-Tab. Can you always tell where focus is, including on image links and at different viewport sizes and zoom levels? A custom indicator should be consistently obvious, not merely present. Check its contrast against adjacent colors and make borders or outlines thick enough to notice. section 5.3.1 section 5.4

