Closed bbhtt closed 1 year ago
it does follow system theme.
here's the relevant code:
when JS is disabled: https://github.com/zyachel/quetre/blob/e9b9c76aa2234d4c3842253d2a49495b0a2f3b79/views/sass/_base.scss#L56-L63
when JS is enabled:
https://github.com/zyachel/quetre/blob/e9b9c76aa2234d4c3842253d2a49495b0a2f3b79/public/js/index.js#L47-L49
moreover it also applies theme colours in the URL bar: https://github.com/zyachel/quetre/blob/e9b9c76aa2234d4c3842253d2a49495b0a2f3b79/views/pug/base.pug#L17-L18
in action:
perhaps you're using a hardened browser(eg: librewolf or firefox with tweaks)?
In those cases, the browser doesn't reveal system theme.
Or maybe you've toggled theme with the button once?
Because if that's the case, your theme preference will be stored in local storage. And next time you visit the website, your toggled preference will be applied, regardless of your system theme.
perhaps you're using a hardened browser(eg: librewolf or firefox with tweaks)? In those cases, the browser doesn't reveal system theme.
No regular Firefox Nightly, no additional config tweaks.
Or maybe you've toggled theme with the button once?
I clear browser data on quit so that shouldn't be an issue.
when JS is disabled:
It seems to be working only when I disable JS; if JS is enabled it is defaulting to the light theme irrespective of my system theme. Here is a video with Firefox Nightly on Android (with JS enabled, then the theme button and lastly with JS disabled), I can see the same behavior with Nightly on desktop.
I can sort of guess why it is not working.
In index.js, browser preference is being checked before user preference.
I'll fix it tomorrow!
will only be able to fix it once I get time. a bit busy for some weeks.
Hi, it'd be great to have support for automatic dark/light mode switching based on system/browser theme with prefers-color-scheme
This would be in addition to the theme button on top.