fix: set isDark corresponding to system theme
This commit is contained in:
parent
addb1460be
commit
6773f7f87d
1 changed files with 1 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ export function ThemeProvider({ children, defaultTheme = "system", storageKey =
|
||||||
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||||
|
|
||||||
root.classList.add(systemTheme ? "dark" : "light");
|
root.classList.add(systemTheme ? "dark" : "light");
|
||||||
|
setIsDark(systemTheme);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue