Skip to content

Conversation

@zerone0x
Copy link
Contributor

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

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

🤖 Generated with Claude Code

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

This causes toast text to be unreadable (dark text on dark background)
in light mode.

Fix by using explicit --smoke-dark-* colors which are always light colors
suitable for dark backgrounds:
- Title/icon: --smoke-dark-12 (#f1ecec, near-white)
- Description/base: --smoke-dark-11 (#b7b1b1, light gray)
- Action weak: --smoke-dark-9 (#716c6b, medium gray)

Fixes anomalyco#7833

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #7834: fix(ui): toast follows theme colors instead of inverted
#7834

Why it's related:

This PR addresses the same toast styling issue. Both PRs are fixing toast text color problems on dark surfaces. PR #7834 takes a different approach ("toast follows theme colors instead of inverted") while the current PR (#7972) uses explicit --smoke-dark-* variables. These are likely two different solutions to the same problem (issue #7833).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(desktop) Install new version toast have black text over black background in Light mode

1 participant