This file contains 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
const getSystemTheme = () => { | |
// Check if the preferred scheme is dark | |
const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches; // Be careful! Not just parantheses and quotes, like ("()") this | |
const mode = isDarkmode ? "dark" : "light"; | |
return mode; | |
} |
NewerOlder