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

Automatically turn on dark mode with prefers-color-scheme #43

Open
Steffan153 opened this issue Nov 2, 2020 · 7 comments
Open

Automatically turn on dark mode with prefers-color-scheme #43

Steffan153 opened this issue Nov 2, 2020 · 7 comments

Comments

@Steffan153
Copy link
Contributor

https://css-tricks.com/dark-modes-with-css/ and https://flaviocopes.com/javascript-detect-dark-mode/ will be useful

@max-programming
Copy link
Owner

Yeah I know that. But I am using Dark Reader. We can use Media Queries by Material UI and it is a Media Query I guess

@Steffan153
Copy link
Contributor Author

I know you use dark reader, but you have a button to turn it on and off so just automatically turn it on when detected

@max-programming
Copy link
Owner

Dark Reader has a method that detects and does something.
https://github.com/darkreader/darkreader#using-for-a-website
Here, Darkreader.auto() is a method that relates to this issue.

@Steffan153
Copy link
Contributor Author

Steffan153 commented Nov 2, 2020

That probably does the same thing, sure.
Edit: Yep https://github.com/darkreader/darkreader/blob/master/src/utils/media-query.ts

@max-programming
Copy link
Owner

That probably does the same thing, sure.
Edit: Yep https://github.com/darkreader/darkreader/blob/master/src/utils/media-query.ts

But, maybe it didn't seem to work on mine. Try it out on your side, does it work?

@PriyalPatney
Copy link

How about auto dark mode can use the current time and switch accordingly! 🤔

@max-programming
Copy link
Owner

How about auto dark mode can use the current time and switch accordingly! 🤔

Maybe we could add a different setting for that. Which can enable dark mode automatically if it's night

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

No branches or pull requests

3 participants