diff --git a/src/components/theme.tsx b/src/components/theme.tsx index 2091f9c..b2c549f 100644 --- a/src/components/theme.tsx +++ b/src/components/theme.tsx @@ -8,7 +8,7 @@ export const themeEvent = () => { export const ThemeSelection = () => { const [theme, setTheme] = createSignal( - localStorage.getItem("theme") === null ? "system" + localStorage.getItem("theme") === null ? "auto" : localStorage.theme === "dark" ? "dark" : "light", ); @@ -18,17 +18,17 @@ export const ThemeSelection = () => { document.documentElement.classList.toggle( "dark", newTheme === "dark" || - (newTheme === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches), + (newTheme === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches), ); - if (newTheme === "system") localStorage.removeItem("theme"); + if (newTheme === "auto") localStorage.removeItem("theme"); else localStorage.theme = newTheme; }; - const ThemeOption = (props: { theme: string; icon: string; label: string }) => { + const ThemeOption = (props: { theme: string; label: string }) => { return ( ); }; return ( -