Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility: Enable an outline focus indicator by default #932

Open
TobyKLight opened this issue Nov 27, 2024 · 0 comments
Open

Accessibility: Enable an outline focus indicator by default #932

TobyKLight opened this issue Nov 27, 2024 · 0 comments
Assignees

Comments

@TobyKLight
Copy link
Contributor

When you press TAB to cycle through interactive HTML elements on a page you should see a so called 'focus highlight' that shows you what element is selected. It would be great to have one of these by default to improve accessibility of everything made by cables.

Browsers usually have this in the default styles so possibly cables.gl own CSS is blocking outline from being drawn? This is perhaps due to concerns the outline appears when not needed, e.g from sighted mouse users clicking on elements.

There is a modern solution for this using the css selector :focus-visible

Generally:

  • :focus-visible This smart option is only meant to show focus indicators when the user needs it. As far as I can tell the focus indicator appears when the user tries to discover elements with TAB key
  • :focus This will also set focus indicators when the user clicks with a pointing device

For more details on this see the MDN entry.


Workaround:
Cables.gl users can of course manually add a :focus-visible style.

For a demo of an outline go to this patch page and press TAB, notice the blue outline

@TobyKLight TobyKLight added the new label Nov 27, 2024
@pandrr pandrr self-assigned this Nov 28, 2024
@steam0r steam0r removed the new label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants