fix(ui): improve tooltip text contrast in light mode themes #9337
+4
−4
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.
Summary
text-invert-*tokensProblem
In light mode, tooltips use a dark background (
neutral[11]) and should have light text for readability. However, for non-OC-1 themes, thetext-invert-*tokens were computed usingneutralAlphavalues which didn't guarantee sufficient contrast. This resulted in dark text on dark backgrounds, making tooltips unreadable.Solution
Change the light mode values for
text-invert-*tokens to use the light end of the neutral scale:text-invert-strong:neutral[0](lightest)text-invert-base:neutral[1]text-invert-weak:neutral[3]text-invert-weaker:neutral[4]These values are guaranteed to be light colors (high luminance) that contrast well against the dark tooltip background.
Changes
packages/ui/src/theme/resolve.ts: Updatetext-invert-*token values for light modeFixes #9333
How did you verify your code works?
The fix ensures that for light mode:
neutral[0]has lightness 0.995 (almost white)neutral[11]has lightness 0.2 (very dark)This guarantees proper contrast for tooltip text on tooltip backgrounds.
🤖 Generated with Claude Code