Last active
July 5, 2020 18:55
-
-
Save willmendesneto/34f501c84d8562cbbce165af9f0094dd to your computer and use it in GitHub Desktop.
dark-mode via css media query
This file contains hidden or 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
html { | |
background: #FFFFFF; | |
} | |
// Detect if the user has requested the system | |
// use a light or dark color theme. | |
// More details about `prefers-color-scheme` in https://web.dev/prefers-color-scheme/ | |
@media (prefers-color-scheme: "dark") { | |
html { | |
filter: invert(100%); | |
} | |
img, video { | |
filter: invert(100%); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment