Skip to content

Instantly share code, notes, and snippets.

@someguy9
Created September 29, 2020 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save someguy9/d83da1da926b8b0dae3404c2e45bb47b to your computer and use it in GitHub Desktop.
Save someguy9/d83da1da926b8b0dae3404c2e45bb47b to your computer and use it in GitHub Desktop.
Media query for Dark Mode in CSS
/* 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