Created
September 29, 2020 19:03
-
-
Save someguy9/d83da1da926b8b0dae3404c2e45bb47b to your computer and use it in GitHub Desktop.
Media query for Dark Mode in CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example dark mode color schema for CSS */ | |
@media (prefers-color-scheme: dark) { | |
body { | |
background-color: #fff; | |
color: #000; | |
} | |
img { | |
opacity: .8; | |
transition: opacity .3s ease-in-out; | |
} | |
img:hover { | |
opacity: 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment