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

Set dark mode based on system settings 🌗 #11

Open
nikolalsvk opened this issue Apr 15, 2020 · 3 comments
Open

Set dark mode based on system settings 🌗 #11

nikolalsvk opened this issue Apr 15, 2020 · 3 comments

Comments

@nikolalsvk
Copy link
Member

The dark mode should be set based on the user's system settings.

We could use something like prefers-color-scheme query .

@nikolalsvk
Copy link
Member Author

Test Slack integration (ignore this comment)

@moonbyt3
Copy link

uu najs, nisam ni znao da ovo postoji.
vidjecu sutra/prekosutra da uradim ovo :)

@Dorson
Copy link

Dorson commented Apr 21, 2020

The CSS rule for @media (prefers-color-scheme: dark) would work, but it would enforce one color only, and for the users that have that rule ON already. No way to switch it ON, Off. Or give it to all as an option.

To resolve that I did the hard work.

Made and tested code for a CSS color switch with memory. Great for the night and evening time.

See live demo on GitHub page:

https://dorson.github.io/CSS-Dark-Mode-and-color-switch/

Have fun, feel free to fork, copy, adopt, port, etc...

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