Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Better contrast for current item in light dropdown #6672

Open
wants to merge 1 commit into
base: develop-minor
Choose a base branch
from

Conversation

distantnative
Copy link
Member

Description

Summary of changes

  • Improve color contrast for current item in light theme dropdown
Screenshot 2024-09-14 at 11 23 03 AM

Reasoning

Using color-blue-700 is actually not fully compliant with WCAG AA, only achieving 4.43:1 contrast ratio.
However the next available color step color-blue-800 is way too dark to be a noticeable difference:
Screenshot 2024-09-14 at 11 23 22 AM

How do we want to deal with such situations. Break out of our color system? #2A78C6 would be conforming and close to color-blue-700.

@distantnative distantnative added the type: a11y 👐 Concerns a change that would make it more accessible to more people label Sep 14, 2024
@distantnative distantnative added this to the 4.5.0 milestone Sep 14, 2024
@distantnative distantnative self-assigned this Sep 14, 2024
@distantnative distantnative linked an issue Sep 14, 2024 that may be closed by this pull request
@distantnative distantnative requested a review from a team September 14, 2024 09:29
@bastianallgeier
Copy link
Member

With the dark theme on the horizon, I start to wonder if we should move to certain purpose-driven variables instead of those color values.

@distantnative
Copy link
Member Author

Like another layer in between: blue-on-dark, blue-on-light?

@bastianallgeier
Copy link
Member

Probably even less color dependent. I'm not sure how verbose we need to be, but if we think about variables that could stick around with any design change, we would probably need something like

--color-primary-dropdown-link-active
--color-primary-dropdown-link

--color-secondary-dropdown-link-active
--color-secondary-dropdown-link

Super unsure about primary and secondary, but we need some sort of description for the dark/white dropdowns that are also independent from the current theme.

@distantnative
Copy link
Member Author

What would primary and what would secondary be?

@bastianallgeier
Copy link
Member

The naming really isn't great. Dark & light make a lot more sense in general, but when we flip it in the dark theme, we can't also flip the wording. That's where it gets messy. I think "primary" would probably be the dark ones, because they are the common ones and light would be "secondary". But maybe it could also be something like:

--color-dropdown-link-active
--color-dropdown-link

--color-dropdown-inverted-link-active
--color-dropdown-inverted-link

@distantnative
Copy link
Member Author

@bastianallgeier I get your approach but we have that in so many places (e.g. --color-white, --color-black are semantical nonsense in dark mode). I'd rather approach that with one common strategy in a separate PR then just start here in this PR.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: a11y 👐 Concerns a change that would make it more accessible to more people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panel: Low text contrast for selected dropdown items
2 participants