Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
dark-mode via css media query
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