fix: auto thme

This commit is contained in:
Ou 2024-10-17 04:45:46 +08:00
parent ff79054692
commit 596b07ee2d

View File

@ -19,7 +19,7 @@ export const Route = createRootRouteWithContext<{
beforeLoad: () => {
const theme = localStorage.getItem("color-scheme") || "auto"
const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches
if (!theme ? isDark : theme === "dark") {
if (theme === "auto" ? isDark : theme === "dark") {
document.documentElement.classList.add("dark")
}