-
Notifications
You must be signed in to change notification settings - Fork 758
Explain focus-visible intent and guidance. #2481
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2260,21 +2260,6 @@ The Focus-Indicated Pseudo-class: '':focus-visible''</h3> | |
| selectively, in order to encourage visible, usable focus styles, and | ||
| discourage the practice of disabling the default user agent focus style. | ||
|
|
||
| <div class=advisement> | ||
| Page authors should follow these guidelines | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems a little disappointing to remove all of the advice for authors. It's not clear to me that the old advice was the best that could be offered, but this does seem like an area where it's worth offering some expert advice on what the right thing really is. |
||
| when deciding whether to use '':focus'' or '':focus-visible'' | ||
| to style the focused state of an element: | ||
|
|
||
| * If the element has “native” focus indicator behavior | ||
| (such as text fields or buttons), | ||
| use '':focus-visible''. | ||
| * Otherwise, if the element is emulating a text input, | ||
| or something else that is <em>intended</em> to receive keyboard interaction, | ||
| use '':focus''. | ||
| * Otherwise, | ||
| use '':focus-visible''. | ||
| </div> | ||
|
|
||
| When UAs choose to specially indicate focus on an element, | ||
|
||
| or whether they specially indicate focus at all, | ||
| is UA-dependent. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a developer, personally I find the previous form of words more straightforward and easier to understand. I'm struggling particularly with the word 'selectively'. The purpose of
:focus-visibleis, as I understand it, to style the focus ring while not overriding the UA's discretion about whether to display it. Therefore this mechanism intentionally doesn't give the developer control over that discretion, whereas I'd interpret 'selectively' in this text as implying that it does.I'm sorry not to be able to suggest an alternative form of words here but I don't think I have a strong enough understanding of the motivation for the change. Is there a desire to be less opinionated about developer behaviour?