Repository navigation
Tooltip, Snackbar: Follow the theme instead of staying dark - #87863
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +622 B (+0.01%) Total Size: 8.86 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Navigates the items list via UP/DOWN arrow keys in
|
21eb7c8 to
518f119
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the overlay theming changes.
No open issues 🎉
What changed in this PR
Implements option C from #87834: overlays follow the editor UI theme rather than staying dark, using surface colors, borders, and shadows consistent with popovers.
Changes:
- Updates tooltips, snackbars, drag chips, and canvas hints to use theme tokens.
- Simplifies snackbar theme inheritance and preserves the invalid-drop symbol in forced-colors mode.
- Updates tooltip assertions and package changelogs.
| File | Description |
|---|---|
| packages/ui/src/tooltip/test/index.browser.test.tsx | Checks theme surface, text, and border colors. |
| packages/ui/src/tooltip/style.module.scss | Applies themed tooltip colors and border. |
| packages/ui/CHANGELOG.md | Documents tooltip appearance changes. |
| packages/editor/src/components/upload-progress-snackbar/style.scss | Removes the white-spinner override. |
| packages/editor/CHANGELOG.md | Removes the obsolete spinner fix entry. |
| packages/edit-site/src/components/layout/index.jsx | Uses content colors for snackbars at all viewport sizes. |
| packages/edit-site/CHANGELOG.md | Updates the snackbar change reference. |
| packages/components/src/tooltip/style.scss | Applies themed tooltip colors and border. |
| packages/components/src/snackbar/style.scss | Themes the snackbar and removes white action overrides. |
| packages/components/src/resizable-box/resize-tooltip/style.module.scss | Themes resize tooltips and adds shadow. |
| packages/components/src/range-control/style.module.scss | Themes range value tooltips. |
| packages/components/CHANGELOG.md | Documents overlay changes and removes obsolete entries. |
| packages/block-editor/src/components/writing-flow/style.scss | Themes the canvas stop hint. |
| packages/block-editor/src/components/block-draggable/style.scss | Themes drag chips and preserves forced-colors symbols. |
| packages/block-editor/CHANGELOG.md | Documents overlay styling and forced-colors improvements. |
Review effort: Balanced
Definitely something to discuss separately, in the same way that the border/stroke treatment should also be addressed holistically for overlays in #87843. Just wanted to note that the "what theme should overlays inherit" argument was discussed relatively recently, and we settled on them inheriting the "root" theme, ie the light theme used in the canvas. We'd also need to understand if this would be an exception for tooltips, or a behaviour to consider for all overlays (including menus, selects, etc) |
I believe we discovered earlier that there would be various problems if overlays inherited the closest theme provider (for example #81183), and after some discussion we settled on keeping the root theme for portaled overlays (#82038). So this is how overlays triggered from the sidebar work today (which the tooltips would match). |
mirka
left a comment
There was a problem hiding this comment.
I also tested around in a Playground, and I couldn't find any particular problems 👍
f54b535 to
2385a4d
Compare
|
Acknowledging that this is a noticeable visual change, I'll wait for @WordPress/gutenberg-design to also give their approval before merging. |
|
I'm ever sceptical, but I wouldn't want that to mean "let's not do this", I just mean let's try this and let's come back and iterate if something comes up. |
jameskoster
left a comment
There was a problem hiding this comment.
I think it makes sense to align with the system without hacks our quirks as a principle, and this does that, so I'm happy to approve. If it turns out to be problematic we can revisit during the 7.3 cycle.
Implement option C from #87834. Tooltip (both packages), Snackbar, the block drag chip, and the canvas stop hint now use the neutral surface, text, and stroke tokens of the theme around them, like popovers, instead of fixed dark colors or swapped tokens. Remove the patches that kept the snackbar action text and upload spinner white. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrite the unreleased Tooltip entries for the final behavior, and remove the unreleased Snackbar and upload spinner fixes that no longer apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Include the border in the chip's height so the chip stays centered on the pointer, and drop a radius the invalid overlay could not inherit.
Snackbars over the mobile sidebar took the admin color scheme, so they turned dark or tinted while tooltips and menus over the same sidebar stay light. Seed them with the content colors everywhere, like the extensible site editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oltips The RangeControl value tooltip and the ResizableBox size tooltip were the last dark tooltips. Give them the theme's surface, text, stroke, and shadow, like Tooltip. Also keep the drag chip's "cannot drop here" symbol in forced-colors mode, which stripped the box-shadow and gradient that draw it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reference the design system tokens directly, like Tooltip and Popover, instead of the legacy `--wp-components-color-*` variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forced-colors mode already draws the stroke in a system color, as it does for Popover.
The tests covered the swapped neutral tokens from #87817. The tooltip now uses the surface tokens like any other overlay, so they no longer test anything specific to it.
a0ab99f to
6d7b5bf
Compare

What?
Closes #87834
Implements option C: tooltips, snackbars, and the other overlays that were dark in every theme now follow the theme, like popovers.
Why?
On a dark canvas or a dark admin area, the always-dark overlays blended into the page, and keeping them dark took workarounds (#87817, #87818). #87834 settled on option C.
How?
Each overlay now uses the popover tokens:
--wpds-color-background-surface-neutral-strong,--wpds-color-foreground-content-neutral, a--wpds-color-stroke-surface-neutralstroke, and--wpds-shadow-outer-sm. This coversTooltipin both packages,Snackbar, theRangeControlandResizableBoxtooltips, the block drag chip, and the canvas stop hint.Note
The stroke matches what popovers use today. The edge treatment for all raised surfaces, a stroke or something else, is being discussed separately in #87843. If the treatment changes there, these overlays should change with popovers.
Overlays follow the theme of the editor UI, not the site's colors, so on a dark site they stay light. In the site editor, they are light over the dark sidebar too, like menus and popovers.
Details
Tooltip(@wordpress/uiand@wordpress/components): replace the swapped tokens from Tooltip: Invert the theme's neutral tokens instead of nesting a dark ThemeProvider #87817.Snackbar: replace the translucent black background and its blur. The action takes the theme's link color instead of white. The upload progress snackbar drops its spinner patch from Snackbar: Use WPDS shadow tokens, improve theme inheritance #87818.RangeControlandResizableBoxtooltips: legacy--wp-components-color-*overrides no longer affect theResizableBoxsize tooltip.$elevation-small.box-shadowand a gradient that forced-colors mode strips, opts out of the color adjustment and usesCanvasText.Testing Instructions
More cases
Testing Instructions for Keyboard
Press Tab through the post editor header toolbar, press Escape in a paragraph, and save with Cmd/Ctrl + S. Each tooltip, the canvas stop hint, and the snackbar are readable.
Screenshots or screencast
Post editor with the default admin color scheme and Twenty Twenty-Five:
More cases, by admin color scheme (admin areas) and theme (canvas):
Default admin color scheme, Twenty Twenty-Five (light site)
Default admin color scheme, Twenty Twenty-Five with the Evening variation (dark site)
Midnight admin color scheme, Twenty Twenty-Four with the Onyx variation (dark site)
Coffee admin color scheme, Twenty Twenty-Five (light site)
Light admin color scheme, Twenty Twenty-Five (light site)
DataViews: Pages in the site editor and the extensible site editor, default and Coffee admin color schemes
RangeControlandResizableBoxtooltips, Twenty Twenty-Five and its Evening variationForced-colors mode (Chromium emulation)
How the screenshots were taken
A Playwright script captured both builds on the same wp-env site at 1440 × 900 (390 × 760 for the mobile shots), 2× scale. Before is
trunkat 6482bdf. After is this branch. The post editor "Post updated." snackbar comes from a real save. The other snackbars use their real messages, dispatched withwp.data.dispatch( 'core/notices' ).createSuccessNotice().Follow-ups
Use of AI Tools
Claude Code (Claude Opus 5.5) wrote the code changes, captured the screenshots, and drafted this description.
🤖 Generated with Claude Code