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

Require :focus styles to accompany :hover #26

Closed
shawnbot opened this issue Mar 25, 2019 · 3 comments
Closed

Require :focus styles to accompany :hover #26

shawnbot opened this issue Mar 25, 2019 · 3 comments

Comments

@shawnbot
Copy link
Contributor

This is an accessibility issue. There have been some discussions about a pseudo-selector that combines the two, but we should at least be warning folks if they add :hover styles without also adding :focus.

/cc @primer/ds-core

@simurai
Copy link
Contributor

simurai commented Mar 26, 2019

One day there might be a :focus-visible pseudo-selector.

This selector is useful to provide a different focus indicator based on the user’s input modality (mouse vs. keyboard).

I think @muan added some "focused with the mouse vs keyboard" trickery on some components.

@muan
Copy link

muan commented Mar 26, 2019

I think @muan added some "focused with the mouse vs keyboard" trickery on some components.

In dotcom we have a short script discerning user intent (mouse or keyboard), and applying outline: none only when .intent-mouse *:focus. Check out button-outline.js/css.

@muan
Copy link

muan commented May 30, 2019

Just came across YozhikM/stylelint-a11y which comes with selector-pseudo-class-focus. ❤️

@shawnbot shawnbot self-assigned this May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants