-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle dark mode automatically per system setting #17
Comments
You can - the reason I went with the manual switch is that at the time Firefox would not detect dark mode of the UI on the window manager automatically on Linux, so I wanted the option to enable it. Also it was a ready made plugin for bootstrap 4 and I like giving users choices instead of forcing things on them. The widget will remember its state across session an keep showing you the dark mode if you previously selected it. |
Yeah, I have nothing against such a widget, it certainly won't hurt. Maybe the default state should then just be determined by the preference. Also, this is then likely a contribution for that plugin we can make. 😃 |
That sounds like a great idea! I think the upstream project is this one: https://github.com/coliff/dark-mode-switch |
Thanks, and yeah, here is the upstream issue: coliff/dark-mode-switch#2 |
FYI, I implemented the idea of https://github.com/coliff/dark-mode-switch/pull/20/files but ensured the user set preference takes priority. |
There is a relatively new CSS media query feature called
prefers-color-scheme
. It allows you to detect whether the system/user wants a dark website, so you can adjust your CSS.Anyway, it would be great, if you could make use of it.
BTW: I also have a Firefox add-on called “Dark Mode Website Switcher” (source code) that you can use to toggle this setting in Firefox directly – without needing to change the system option. Maybe that could be helpful e.g. for debugging.
I may look into implementing this by myself, if that is okay.
The text was updated successfully, but these errors were encountered: