Focus Ring! -- A11ycasts #16

31 065
17.8
Опубликовано 24 марта 2017, 16:57
Focus-ring on GitHub: goo.gl/GZCfmQ

Have you ever noticed the little blue or dashed ring that appears around elements when you activate them with your keyboard or mouse? This is known as a focus indicator, and it's extremely important for users who rely primarily on their keyboard to navigate the screen. For a keyboard user, the focus indicator (or ""focus ring"") is kind of like their mouse pointer. It shows them which element is currently active and receiving keyboard events. Because the focus ring can show up on custom controls or whenever we add styles to native elements like the button tag, it's a common anti-pattern to remove the focus indicator using the CSS outline: none style. But doing this degrades the user experience for our keyboard users as they are no longer able to tell which elements are currently focused.

Enter :focus-ring! The :focus-ring pseudo class is a new CSS selector designed to help differentiate between mouse and keyboard focus. Today on a11ycasts we'll look at how :focus-ring works, and show off a few :focus-ring polyfills that you can start using today to improve the accessible styles on your site!

:focus-ring in CSS Selectors Level 4 spec: goo.gl/ljrqNg

what-input on GitHub: goo.gl/BT49JG

Watch all A11ycasts episodes: goo.gl/06qEUW

Subscribe to the Chrome Developers YouTube channel for updates on new episodes of A11ycasts: goo.gl/LLLNvf
автотехномузыкадетское