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

V4.beta Dropdown menu focus/hover style constrast too low for accessibility #23329

Closed
tmorehouse opened this issue Aug 11, 2017 · 12 comments · Fixed by #32754
Closed

V4.beta Dropdown menu focus/hover style constrast too low for accessibility #23329

tmorehouse opened this issue Aug 11, 2017 · 12 comments · Fixed by #32754

Comments

@tmorehouse
Copy link
Contributor

The current :focus / :hover styling is almost impossible to see (on some screens) as it is a very subtle change.

I would recommend that the background be darkened slightly to make it better for keyboard-only users to know which .dropdown-item they have highlighted.

In this screen shot, I have Another Item focused, and at quick glance (without straining my eyes) I can't tell which menu item is focused:
image

Doing the same thing, but adjusting the background color from background-color:#f8f9f8 to background-color:#e8e9e8 makes a big difference in being able to tell which menu item has focus:

image

@XhmikosR
Copy link
Member

/CC @patrickhlauke

pi0 pushed a commit to bootstrap-vue/bootstrap-vue that referenced this issue Aug 11, 2017
@tmorehouse
Copy link
Contributor Author

tmorehouse commented Aug 11, 2017

Our current workaround is to darken the background via box-shadow:

.dropdown-item:focus,
.dropdown-item:hove {
    /* @See https://github.com/twbs/bootstrap/issues/23329 */
    box-shadow: inset 0px 0px 400px 110px rgba(0, 0, 0, .09);
}

.dropdown-item.active {
    box-shadow: initial;
}

@browner12
Copy link
Contributor

you can also use the following variables:

$dropdown-link-hover-color: #fff;
$dropdown-link-hover-bg: #f00;

@pi0
Copy link

pi0 commented Aug 22, 2017

@browner12 While this suggestion is so nice, libraries like BootstrapVue just try to abstract bootstrap components (I mean not providing a pre-compiled BS css by default) and currently shadow hack tries to override user ones which is not a perfect solution. Maybe we can change variables for bootstrap defaults as an accessibility enhancement :)

@browner12
Copy link
Contributor

agreed, having a more contrasting default would be good.

@patrickhlauke
Copy link
Member

See #23990 for a partial fix for this.

@tmorehouse
Copy link
Contributor Author

tmorehouse commented Sep 21, 2017

@patrickhlauke Does this also address button focus styling? It is possible to mix buttons and links together in the same dropdown, and they should both look the same to the user

@frederikhors
Copy link

Is there any news about it?

@mdo
Copy link
Member

mdo commented Jan 10, 2021

This applies to v4 and v5. Would $gray-200 be enough as opposed to the current $gray-100? And does this apply to our dark mode dropdown as well?

@patrickhlauke
Copy link
Member

for keyboard users, focus styles now don't suppress the outline (per #23990). i'd still say that for sighted mouse users, the overly subtle change in background is practically invisible as it currently stands. changing from $gray-100 to $gray-200 (which shakes out to #E9ECEF by default) seems subjectively much better.

Current using $gray-100

dropdown-hover-current

Changed to $gray-200

dropdown-hover-darker

the dark dropdown variant looks, subjectively, good to me as it is.

dropdown-hover-current-dark

@patrickhlauke
Copy link
Member

@patrickhlauke Does this also address button focus styling? It is possible to mix buttons and links together in the same dropdown, and they should both look the same to the user

general button focus styling is still a bit on the low contrast side. but specifically for dropdowns, yes you can mix and match links/buttons and i think they look the same styling-wise now

@patrickhlauke
Copy link
Member

PR for the change to $gray-200 #32754

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

Successfully merging a pull request may close this issue.

7 participants