Skip to content

Instantly share code, notes, and snippets.

@bryceadams
Created July 25, 2022 06:55
Show Gist options
  • Save bryceadams/4abd568b037b7d8a18c6a9b673ca13e6 to your computer and use it in GitHub Desktop.
Save bryceadams/4abd568b037b7d8a18c6a9b673ca13e6 to your computer and use it in GitHub Desktop.
const dark = window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)') &&
window.matchMedia('(prefers-color-scheme: dark)').matches;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment