Allow tooltip color customization#79612
Draft
shaunandrews wants to merge 1 commit into
Draft
Conversation
|
Size Change: +220 B (0%) Total Size: 7.52 MB 📦 View Changed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
See Automattic/studio#3981.
Adds tooltip popup color customization variables:
--wp-ui-tooltip-background-color--wp-ui-tooltip-colorThe default tooltip appearance is unchanged because both variables fall back to the existing WPDS tooltip surface and foreground tokens. The PR also adds a Storybook story showing per-instance color customization through
Tooltip.Portal.Why?
Consumers can already customize tooltip stacking with
--wp-ui-tooltip-z-index, but tooltip colors are currently fixed inside the component stylesheet. That makes app-level theme adjustments hard when a product needs a different tooltip treatment in a specific theme, such as Studio's dark mode.Exposing semantic tooltip CSS variables gives consumers a stable API instead of pushing them toward generated CSS module selectors or wrapper-specific workarounds.
How?
The tooltip stylesheet now reads the popup background and text colors from CSS custom properties before falling back to the current design-system tokens.
The new Storybook example mirrors the existing custom z-index story: consumers can set the variables globally on
:root/body, or per tooltip by passing a styledTooltip.PortaltoTooltip.Popup.Testing Instructions
Validation run:
git diff --checkFull Gutenberg lint/test commands were not run in this temporary sparse checkout because dependencies were not installed.
Testing Instructions for Keyboard
Screenshots or screencast
Not captured.
Use of AI Tools
Codex helped trace the downstream Studio use case and draft this small source change. I reviewed the resulting diff before opening the PR.