Repository navigation
Keep modal and peer-row surfaces readable under the theme's text - #891
Open
awizardxch wants to merge 1 commit into
Open
awizardxch wants to merge 1 commit into
awizardxch wants to merge 1 commit into
Conversation
Themes with a background image set --background to transparent. The app modal shell then took --secondary as its panel tint, and the mobile peer rows paint with --secondary directly. A theme whose secondary is light under light text (the minted awizard theme: #f5f5f5 under #e0f7ff) showed white panels with unreadable text in the bridge approval modals and white peer rows on mobile. Both now pick the first theme surface that is opaque enough and contrasts at least 3:1 with --foreground: the modal tries background, secondary, muted, card, then popover; the peer row keeps secondary when readable, then popover, card, background. When nothing qualifies the fallback is chosen against the text color (dark under light text, white under dark text), never white under white. Themes whose current choice is readable are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
Themes with a background image set
--backgroundtotransparentso the image shows through. Two surfaces then fall back to--secondary:AppModalShell/SystemModalShellviaresolveBackgroundTint): the first non-transparent candidate after--backgroundis--secondary.PeerListMobileRow): painted with--secondarydirectly, opaque so the swipe-to-delete trash can stays hidden.A theme whose secondary is light under light text, such as the minted awizard theme (
secondary: #f5f5f5,foreground: #e0f7ff), shows white bridge-approval modals and white peer rows with near-invisible text. The theme is an NFT, so its JSON can't be edited.Change
Both places now pick the first theme surface that is opaque enough and has at least 3:1 contrast with
--foreground. Colors are read through the browser's own parser, so hex,rgb(),hsl()and bare HSL channels all work.--background,--secondary,--muted,--card, then--popover, the theme's own floating-surface color, added before the hard fallback.--secondaryis kept whenever it is readable, then--popover,--card,--background.#1d2530under light text,#ffffffunder dark text. It is never white under white text.Themes whose current choice is already readable are unchanged. A check in a browser engine with real theme values:
--popover(dark)--popover(dark)--background(unchanged)--secondary(unchanged)--background(unchanged)--secondary(unchanged)#1d2530#1d2530tsc -p tsconfig.app.json,eslintandprettierpass on the touched files.🤖 Generated with Claude Code