Explain the role of the ':focus-visible' pseudo-class in enhancing web usability.
Instruction: Describe how ':focus-visible' can be used to improve accessibility and usability in web design.
Context: This question tests the candidate's understanding of the ':focus-visible' pseudo-class, a CSS feature aimed at improving accessibility by providing visual feedback on elements that have focus.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
:focus matches a focused element. :focus-visible also requires the browser's heuristics to determine that a focus indicator should be shown. It is not simply a keyboard-only switch: a text input may match after a pointer click because the user needs to type there...