From a44e46619f3b58b4649ca59d800be99b9da9ed66 Mon Sep 17 00:00:00 2001 From: Topvennie Date: Sun, 20 Oct 2024 14:07:07 +0200 Subject: [PATCH 1/2] vinvoor: use system color default --- vinvoor/src/providers/ThemeProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vinvoor/src/providers/ThemeProvider.tsx b/vinvoor/src/providers/ThemeProvider.tsx index 957c63b..293b7c6 100644 --- a/vinvoor/src/providers/ThemeProvider.tsx +++ b/vinvoor/src/providers/ThemeProvider.tsx @@ -21,7 +21,7 @@ export const ThemeContext = createContext({ export const ThemeProvider: FC = ({ children }) => { const [themeMode, setThemeMode] = useState( - (import.meta.env.VITE_DEFAULT_THEME_MODE as ThemeMode) || "light", + window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ); const setTheme = (theme: ThemeMode) => { From 4fc59fa80e4fbf1f2a351266e8d36ee4d601b4ad Mon Sep 17 00:00:00 2001 From: Topvennie Date: Sun, 20 Oct 2024 14:10:23 +0200 Subject: [PATCH 2/2] vinvoor: format --- vinvoor/src/providers/ThemeProvider.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vinvoor/src/providers/ThemeProvider.tsx b/vinvoor/src/providers/ThemeProvider.tsx index 293b7c6..6608456 100644 --- a/vinvoor/src/providers/ThemeProvider.tsx +++ b/vinvoor/src/providers/ThemeProvider.tsx @@ -21,7 +21,9 @@ export const ThemeContext = createContext({ export const ThemeProvider: FC = ({ children }) => { const [themeMode, setThemeMode] = useState( - window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", + window.matchMedia("(prefers-color-scheme: dark)").matches + ? "dark" + : "light", ); const setTheme = (theme: ThemeMode) => {