-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Better colour schemes #3706
Labels
enhancement
New feature or request
Comments
Some starter code since I tackled something similar recently: https://gist.github.com/BrianHung/5941bae43559272151caa355c42b112f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a few issues with the way we currently handle colour schemes:
We have the
inferDarkMode
prop, which infers the system colour scheme, but only until you choose light or dark mode. After that you are stuck to manually selection. There's no way of going back to system theme.It does not update when the system colour scheme updates (it's not reactive). In fact it can get quite confusing since changes to other user preferences can trigger the change. See how we only pick up the change after the reduce motion change.
CleanShot.2024-05-06.at.17.10.41.mp4
isDarkMode
from user's preferences andinferDarkMode
from the Editor props.What if replaced
isDarkMode
property onTLUserPreferences
withcolorScheme
which would allow (at least) the following properties:dark
,light
,system
.We can also use
change
event listener on theprefer-color-scheme
media query to listen for changes.Here's PR that explores the suggestion.
The text was updated successfully, but these errors were encountered: