-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update tooltip colors #50792
Update tooltip colors #50792
Conversation
Size Change: -33 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Flaky tests detected in 6f74e13. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5047627913
|
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.
Any preference?
It would be helpful with feedback on this one from component container contributors. |
My preference would likely be dictated by feedback around theming. In that respect I suppose it's a conceptual question about whether tooltips should be a shade lighter or darker than the base background color. In the examples below the lighter shade works a bit better for me. Both in terms of perceived elevation, and because the darker shade has a 'disabled' feel about it in light mode. What do you think? Of course Tooltips may be a unique case, and display the same regardless of mode / theme. I'll cc @SaxonF as I know he's thought about these details more than me :) |
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.
Basically, the theme-ready gray-*
scale is set up to darken in inverse directions based on whether the theme background is considered dark or light. (See this color scheme demo in Storybook and tweak the control for the background
prop.)
Based on the theme-ready colors we have at our disposal right now, a straightforward combination would be:
background: $components-color-gray-100;
color: $components-color-foreground;
This way the tooltip background is guaranteed to be at least slightly different from the themed background color. However, this will be a major stylistic change for all the current usages of Tooltip, being that most app backgrounds tend to be white.
CleanShot.2023-05-22.at.23.25.19.mp4
Tooltips may be a unique case, and display the same regardless of mode / theme.
Yes, a completely static setup (as proposed in this PR) is also probably fine for now, though not 100% theme-ready because we can't guarantee that black
has sufficient contrast against the themed background color. But I am ok with merging as is, we can deal with it later when it comes to it 👍
Yeah the theming part is a bit more involved. I was playing with some ideas at the weekend and figured we may need to consider things like elevation here too. Not necessarily shadows, but the general order/layering of different materials (tooltips, popovers, snackbars, modals, the frame etc), and the affect that has on coloring. With that said, I'll merge this as it addresses a pain point in trunk, and we can circle back when we have a more robust color system in place. |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
What?
Update the tooltip colors.
Why?
The current colorisation causes them to blend into the dark material in the site editor:
This PR changes the background color to
$gray-800
, but black could work too:cc @ciampo @mirka as I noticed some preparatory theming styles were used here. I didn't want to update
$components-color-foreground
as I'm sure it's used elsewhere without issue.