const darkTheme = window.matchMedia("(prefers-color-scheme: dark)"); if (darkTheme.matches) { document.documentElement.classList.add("dark"); } else { document.documentElement.classList.remove("dark"); }