diff --git a/src/components/Theme/ThemePrivider.tsx b/src/components/Theme/ThemePrivider.tsx index 31c1eee..f47ce34 100644 --- a/src/components/Theme/ThemePrivider.tsx +++ b/src/components/Theme/ThemePrivider.tsx @@ -68,6 +68,9 @@ export function ThemeProvider({ useEffect(() => { if (activeTheme && activeTheme !== "system") { setTheme(activeTheme); + } else { + const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)"); + mediaQuery.matches ? setTheme("dark") : setTheme("light"); } localStorage.setItem(storageKey, activeTheme || "system"); }, [activeTheme]);