-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve focus state for .SideNav and .menu #1391
Conversation
🦋 Changeset detectedLatest commit: 534c8f6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
This looks great to me ✨
&:focus { | ||
z-index: 1; | ||
outline: none; | ||
box-shadow: var(--color-state-focus-shadow); | ||
} |
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.
This might be a bigger accessibility question but should/could we make this a default for all focusable elements?
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.
Hmm.. yeah. Currently we have a mix between native focus (e.g. links) and custom focus (input, button). It would be nice to unify it:
*:focus {
outline: none;
box-shadow: var(--color-state-focus-shadow);
}
But we'd have to tweak existing components like the underline nav:
Another option might be to only change the outline color:
*:focus {
outline-color: var(--color-border-info);
}
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.
Added an issue here: https://github.com/github/primer/issues/160
This makes the
:focus
state more visible for.SideNav
and.menu
. Currently only the background changes, but it's too subtle.It doesn't look that great, but maybe still better than only have a subtle change in background. Also, the these two components will probably be replaced sooner or later.