You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
prefers-color-scheme media query not updated when changing nativeTheme.themeSource #22846
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
Electron Version:
v8.2.0
Operating System:
Windows 10 (17763)
Last Known Working Electron version:
n/a
Expected Behavior
When setting nativeTheme.themeSource, the prefers-color-scheme media query updates accordingly and all elements using the query on the page are restyled.
Actual Behavior
Setting nativeTheme.themeSource does not appear to update the media query until a system-level change to the light/dark theme is made.
e.g. if we do nativeTheme.themeSource = "dark", then running matchMedia("(prefers-color-scheme: dark)").matches returns false.
Activity
tinselspoon commentedon Mar 30, 2020
Thanks for the quick fix!