Open ubik23 opened 4 years ago
The code contained in this file ( src/sass/_style.scss ) is supposed to fix this problem. But it doesn't work.
The good news is that it works fine with the dark mode of the OS (windows), automatically. It's cool.
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { console.log('the dark mode'); }else { console.log('the light mode'); }
the above code should detect the current browser theme, it doesn't work.
But it still detects the OS theme, that's a good point.
It looks like it isn't available yet :-/
"The current browser support is very limited, and it’s not available in any of the stable releases of any vendor."
is there a way to remember a user's preference? If we use the checkbox hack, Firefox will remember the state of the checkbox. Any ideas?
Cookie. See also https://github.com/GoogleChromeLabs/dark-mode-toggle
If I set my theme to dark mode in Firefox like so:
https://geekermag.com/firefox-dark-theme/
And I open the Character Creator, it still shows light mode by default.
Perhaps the solution can be found here:
https://css-tricks.com/dark-modes-with-css/