[PR #9337] fix(ui): improve tooltip text contrast in light mode themes #13078

Open
opened 2026-02-16 18:17:57 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9337

State: open
Merged: No


Summary

  • Fixes tooltip text being unreadable in light mode for non-OC-1 themes
  • Uses direct neutral scale colors instead of computed neutralAlpha values for text-invert-* tokens
  • Ensures proper contrast between tooltip text and the dark tooltip background across all themes

Problem

In light mode, tooltips use a dark background (neutral[11]) and should have light text for readability. However, for non-OC-1 themes, the text-invert-* tokens were computed using neutralAlpha values 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: Update text-invert-* token values for light mode

Fixes #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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9337 **State:** open **Merged:** No --- ## Summary - Fixes tooltip text being unreadable in light mode for non-OC-1 themes - Uses direct neutral scale colors instead of computed neutralAlpha values for `text-invert-*` tokens - Ensures proper contrast between tooltip text and the dark tooltip background across all themes ## Problem In light mode, tooltips use a dark background (`neutral[11]`) and should have light text for readability. However, for non-OC-1 themes, the `text-invert-*` tokens were computed using `neutralAlpha` values 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`: Update `text-invert-*` token values for light mode Fixes #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](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-16 18:17:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13078