-
Notifications
You must be signed in to change notification settings - Fork 16
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
Set default theme based on prefers-color-scheme media query #15
Comments
Hi @rijkvanzanten, apologies for the delay on this one also. This is an interesting idea. We'll have to find out if the system colour scheme if available across various browsers. |
Seeing we mostly rely on the text editor plugin to provide the styles, we'd have to read out this media query from JS, which is possible by using const hasDarkModeEnabled = window.matchMedia('"prefers-color-scheme: dark)"); (see https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) |
An interesting edge case is what happens when someone changes from light to dark mode while having the app open? The media query will automatically change, but the editor has to be re-initialized. While this sounds like a big edge case, macOS can toggle between light and dark on sunset / sunrise. If you combine that with keeping a lot of tabs open, you can end up in a situation where the app UI changed, but the editor didn't. |
It would be pretty neat if the app would default its color scheme based on the color scheme of the OS of the user.
The text was updated successfully, but these errors were encountered: