Repository navigation
Conversation
The paper-pane style now sets color-scheme to light dark, so each tab iframe's prefers-color-scheme follows the OS. The library adds a change listener on that media query and reapplies the theme saved in preferences. The library page test double can report a color scheme and dispatch change events, and a new test checks that the pane rule includes color-scheme: light dark, that the base stylesheet does not, and that a scheme change reapplies auto, light, dark, and a missing theme. Fixes Edwardxlai#148
Owner
|
@mvanhorn Thanks for tracing this to the tab iframe. Both focused tests passed locally. The next check is on our side: toggle the Windows theme with the library and a paper open, then restart and confirm both tabs follow the OS. |
Owner
|
I’m planning to ship this fix in v1.5. I’ve included your patch in the local v1.5 preview and will run the remaining Windows desktop check before release. Thanks for the fix! |
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.
Why
In the desktop app, Follow system does not keep the interface in step with the operating system's light or dark appearance. The library can stay light while the system is dark, it stays put when the system switches, and reopening the app can still leave it light; after a manual dark theme, returning to Follow system can leave the app dark as the system changes.
Each paper tab is an iframe whose color-scheme was only the shell's current one: light from the default page style, or dark after a manual dark theme. Chromium then reports prefers-color-scheme inside that frame as that single scheme, so Follow system reads the shell's theme rather than the OS, and the shell copies that reading back onto itself. The library applied the saved theme only at load and never subscribed to later prefers-color-scheme changes.
Summary of the fix
The paper-pane style now sets color-scheme to light dark, so each tab iframe's prefers-color-scheme follows the OS. The library adds a change listener on that media query and reapplies the theme saved in preferences. The library page test double can report a color scheme and dispatch change events, and a new test checks that the pane rule includes color-scheme: light dark, that the base stylesheet does not, and that a scheme change reapplies auto, light, dark, and a missing theme.
Verification
tests/helpers/library_page.cjsandtests/web/test_library_theme.cjsfail without the fix in the easyread change (checked by reverting the source changes).Closes #148