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
No matter which theme I set in the Tauri config file, the WebView always answers CSS media query prefers-color-scheme with OS color theme. According to the doc, it should only be the behavior is the theme field is None.
There is a similar issue in Electron, and they managed to fix it by "propagate preferred color scheme to the renderer".
Reproduction
Set Windows color mode in Personalization to "Dark".
In tauri.conf.json, set windows[0].theme to "Light".
In Rust main(), call main window's theme() to make sure it is tauri::Theme::Light.
In CSS, have different style for of both @media (prefers-color-scheme: light) and @media (prefers-color-scheme: dark).
Observe that the section in @media (prefers-color-scheme: dark) is used.
Expected behavior
If theme() returns Light, styles in @media (prefers-color-scheme: light) should be used.
Describe the bug
No matter which theme I set in the Tauri config file, the WebView always answers CSS media query
prefers-color-scheme
with OS color theme. According to the doc, it should only be the behavior is thetheme
field isNone
.There is a similar issue in Electron, and they managed to fix it by "propagate preferred color scheme to the renderer".
Reproduction
windows[0].theme
to "Light".main()
, call main window'stheme()
to make sure it istauri::Theme::Light
.@media (prefers-color-scheme: light)
and@media (prefers-color-scheme: dark)
.@media (prefers-color-scheme: dark)
is used.Expected behavior
If
theme()
returnsLight
, styles in@media (prefers-color-scheme: light)
should be used.Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: