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

Improve focus state for .SideNav and .menu #1391

Merged
merged 2 commits into from
May 13, 2021
Merged

Improve focus state for .SideNav and .menu #1391

merged 2 commits into from
May 13, 2021

Conversation

simurai
Copy link
Contributor

@simurai simurai commented May 11, 2021

This makes the :focus state more visible for .SideNav and .menu. Currently only the background changes, but it's too subtle.

sidenav

menu

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.

@changeset-bot
Copy link

changeset-bot bot commented May 11, 2021

🦋 Changeset detected

Latest commit: 534c8f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Patch

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

Copy link
Contributor

@koddsson koddsson left a 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 ✨

Comment on lines +36 to +40
&:focus {
z-index: 1;
outline: none;
box-shadow: var(--color-state-focus-shadow);
}
Copy link
Contributor

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?

Copy link
Contributor Author

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);
}

focus-2

But we'd have to tweak existing components like the underline nav:

Screen Shot 2021-05-13 at 19 28 48

Another option might be to only change the outline color:

*:focus {
  outline-color: var(--color-border-info);
}

focus-3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants