Success Criterion 2.4.7 Focus Visible: [Level AA]
Techniques
Provide indication of component in focus using default user agent action
This is most simply done by ensuring a vertical blinking bar is displayed at the insertion point in a text field or button text and links have a dotted focus highlight rectangle surrounding them.
Using CSS to provide focus hints
CSS can be used to provide a change to the presentation of components that are in focus such as changing the background colour. Ensure that both mouse and keyboard focus are catered for.
Using JavaScript to provide focus hints
JavaScript can also be used to provide a change to the presentation of components that are in focus such as changing the background colour. Ensure that both mouse and keyboard focus are catered for. Please not that the default presentation of some controls, e.g. button borders, cannot be re-instated after JavaScript has been used to modify the CSS. In this example we are using the CSS property outline.
Failures
Styling outlines and borders in a way that removes or renders non-visible the focus indicator
Some CSS changes can inhibit the default functionality of control focus. Any derived focus indicators similar to the default will be not easily visible as will any that obstruct default indicators.