Skip to content

fix: support media query for color schemes#2361

Open
twio142 wants to merge 1 commit into
brookhong:masterfrom
twio142:fix/color-schemes
Open

fix: support media query for color schemes#2361
twio142 wants to merge 1 commit into
brookhong:masterfrom
twio142:fix/color-schemes

Conversation

@twio142

@twio142 twio142 commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

This enables @media (prefers-color-scheme: dark) in settings.theme.

When uiHost.style.colorScheme is undefined, or set to "normal", the iframe can also follow the system theme but shows an white background when switching to dark mode. Setting it to "auto" avoids this issue.

also prevents the canvas' white background when color scheme is dark
@brookhong

Copy link
Copy Markdown
Owner

We need be careful about this, please see #1719 #1898 , I'll verify if the change would work for Safari/iPhone.

hbt added a commit to hbt/Surfingkeys that referenced this pull request May 30, 2026
Fixes white background flash in the SK UI iframe when OS/browser is in dark
mode. uiHost.style.colorScheme was hardcoded to "light", forcing the browser
to render the iframe with light-mode default backgrounds even when user theme
CSS uses @media (prefers-color-scheme: dark).

Refs upstream PR brookhong#2361
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.

2 participants