Skip to content
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

Don't you want to detect what color scheme the user has requested? #58

Open
fromaline opened this issue Oct 27, 2020 · 3 comments
Open

Comments

@fromaline
Copy link
Contributor

Does it make sense to you, if initially, the values of custom properties would reflect the color scheme which the user prefers (dark or light theme)?


This feature is CSS-based and almost all browsers, that you currently support, support this functionality, except for Edge (supports only from version 79) and IE. There it will have no effect.

@jenil
Copy link
Owner

jenil commented Oct 27, 2020

Yeah I wrote some docs about how this is done using JS here https://jenil.github.io/chota/#customizing.
We can add a CSS-based solution.

@fromaline
Copy link
Contributor Author

fromaline commented Oct 27, 2020

Yeah, I've seen it, your solution is great.
Maybe it just me preferring a CSS-based solution if possible because it's a bit more convenient to have as much style-related stuff in CSS as possible.

@gagarine
Copy link

The way to go is to use https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

Additionally, ou can use a class if you want to toggle the dark mode from javascript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants