opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(ui): use explicit light text colors for toast on dark float surface

Open zerone0x opened this issue 2 days ago • 1 comments

Summary

Fixes #7833

Toast text is unreadable in Light mode because dark text appears on a dark background.

Root Cause

The toast component uses --surface-float-base which is a dark surface in both light and dark modes. However, it was using --text-invert-* CSS variables for text colors. These variables don't properly resolve to light colors in light mode due to how neutralAlpha is calculated in the theme resolver (resolve.ts).

This causes:

  • Light mode: Dark text on dark toast background (unreadable)
  • Dark mode: Works correctly

Changes

Replace --text-invert-* variables with explicit --smoke-dark-* colors which are always light colors suitable for dark backgrounds:

Element Old Variable New Variable Color
Title --text-invert-strong --smoke-dark-12 #f1ecec (near-white)
Description --text-invert-base --smoke-dark-11 #b7b1b1 (light gray)
Icon --text-invert-stronger --smoke-dark-12 #f1ecec
Action (weak) --text-invert-weak --smoke-dark-9 #716c6b (medium gray)
Action (first) --text-invert-strong --smoke-dark-12 #f1ecec

Test plan

  • [x] UI package typechecks pass
  • [ ] Visual verification: Toast text is readable in both Light and Dark modes

🤖 Generated with Claude Code

zerone0x avatar Jan 12 '26 10:01 zerone0x