Last active
May 22, 2024 02:22
-
-
Save ThaddeusJiang/713ee2167865e52836368d6c32f9c1e9 to your computer and use it in GitHub Desktop.
isDark in JS - dark mode
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
export const isDark = () => 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