Problem/Motivation

Focus styles should only apply when they are really necessary, e.g. when navigating with the keyboard. See this explanation on MDN:

Browsers no longer visibly indicate focus (such as by drawing a "focus ring"), around each element when it has focus. Instead, they use a variety of heuristics to provide focus indicators only when it would be most helpful to the user. For instance, when a button is clicked using a pointing device, the focus is generally not visually indicated, but when a text box needing user input has focus, focus is indicated.

Proposed resolution

Use the :focus-visible pseudo-selector, instead of :focus.

CommentFileSizeAuthor
#3 3427070-focus_visible-2.0.x-3.patch22.93 KBmrshowerman
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mrshowerman created an issue. See original summary.

mrshowerman’s picture

Assigned: mrshowerman » Unassigned
Status: Active » Needs review
StatusFileSize
new22.93 KB

Opened MR against 2.1.x, adding patch for 2.0.x.

hexabinaer’s picture

I am reluctant. Admittedly this is the more modern approach and surely makes it nicer for sighted users. Have you checked back with different input devices in all instances?

mrshowerman’s picture

Not myself. But this is also how it is done in the Bootstrap framework (e.g., buttons), and accessibility plays an important role there.

mrshowerman’s picture

Version: 2.1.x-dev » 2.6.x-dev