Describe the bug
In my application I use the prefers-color-scheme media to change the color scheme of my app. It works on Chrome/Firefox/Epipahny (on Linux) but not on Tauri. I tried listening to tauri://theme-changed for what Tauri sees but the result is always light even if dark mode is enabled in GNOME.
Reproduction
- Make a new Tauri project using V1
- Listen to
tauri://theme-changed for theme changes or directly print the appWindow.theme() promise
- See that
light returns even if a dark theme is active in the system
Expected behavior
I expect it to return dark if the system is using a dark theme.
Full tauri info output
[✔] Environment
- OS: Linux Unknown X64
✔ webkit2gtk-4.0: 2.42.4
✔ rsvg2: 2.54.7
✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
✔ cargo: 1.77.1 (e52e36006 2024-03-26)
✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 18.19.0
- pnpm: 8.15.5
- npm: 9.2.0
[-] Packages
- tauri [RUST]: 1.6.1
- tauri-build [RUST]: 1.5.1
- wry [RUST]: 0.24.7
- tao [RUST]: 0.16.8
- @tauri-apps/api [NPM]: 1.5.3
- @tauri-apps/cli [NPM]: 1.5.11
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:1420/
- framework: Vue.js
- bundler: Vite
Stack trace
No response
Additional context
For instance, I am using the default theme (Adwaita) in GNOME 44.8. I also managed to reproduce the same issue using Tauri v2.
Describe the bug
In my application I use the
prefers-color-schememedia to change the color scheme of my app. It works on Chrome/Firefox/Epipahny (on Linux) but not on Tauri. I tried listening totauri://theme-changedfor what Tauri sees but the result is alwayslighteven if dark mode is enabled in GNOME.Reproduction
tauri://theme-changedfor theme changes or directly print theappWindow.theme()promiselightreturns even if a dark theme is active in the systemExpected behavior
I expect it to return
darkif the system is using a dark theme.Full
tauri infooutputStack trace
No response
Additional context
For instance, I am using the default theme (Adwaita) in GNOME 44.8. I also managed to reproduce the same issue using Tauri v2.