-
Notifications
You must be signed in to change notification settings - Fork 72
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
Button text does not adjust between light and dark mode #935
Comments
This is caused by this line: oui/src/components/button/_button.scss Line 99 in fe979c3
Essentially, what's happening is that it thinks those colors are dark mode when it's light mode because of the contrast ratio calculation: oui/src/global_styling/functions/_colors.scss Lines 86 to 95 in fe979c3
(basically it just chooses the color with the higher contrast ratio) This means we'll need to adjust the colors for the buttons to render correctly (primary and warning) |
That was my guess - the thing that's driving me crazy is in testing from the color selection light text on the button color passes contrast tests on my end. I will try to adjust the primary as soon as possible to see if that fixes it with the compiler. |
Just to add some context from the current theme. The default
In the current dark mode overrides, that is adjusted to the lighter oui/src/themes/oui/oui_colors_dark.scss Line 19 in 1ff6493
In the
And in
Note that the Given this, it seems like our preference would be:
We can accomplish 2. specifically by adding some conditional logic that doesn't bother calling @kroosh does that assessment sound right to you? I don't think we should let the internal implementation of filled buttons dictate what color you pick for primary. |
" Note that this wouldn't change behavior for other color filled buttons." -what other color filled buttons are there? I also dont want to change the primary color. I did not realize that button color primary was being updated in the Light/Dark for current - that sounds kind of sketchy to keep trying to chase all these transformations. With the font weight having increased on buttons as per #807 , the contrast for light text on the primary color is correct. I dont like that its choosing the higher version even if , as you stated, the desired use is sufficiently high enough. I reached out to @BSFishy with some of these approach shifts as well, so if this is good with you guys, its good with me. The dark text on the primary may be registering higher mathmatically, but its not perceptually correct. |
No that's not what's happening. The primary color is not transformed. It's just used to determine which text color to use. I just meant we should be able to get the behavior we want regardless of the choice of primary. But also to note that the |
We can go ahead with the simplest fix first, and see the outcome on all the filled button styles: https://oui.opensearch.org/1.2/#/navigation/button |
fixed by #981 |
In current light & dark mode - button text adjusts accordingly - however in
next
- the button text appears dark in light mode.Is this a bug with
Next
or do we need to adjustouiColorPrimary
to fix any issues with the contrast function?The text was updated successfully, but these errors were encountered: