Skip to content

Commit 1fa2106

Browse files
committed
feat(theme): default to gray theme when no preference exists
- Use as the initial theme and when no saved preference is found - Applies class on first load for consistent styling
1 parent 4a6b168 commit 1fa2106

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/contexts/ThemeContext.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const DEFAULT_CUSTOM_COLORS: CustomThemeColors = {
5858
};
5959

6060
export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
61-
const [theme, setThemeState] = useState<ThemeMode>('dark');
61+
const [theme, setThemeState] = useState<ThemeMode>('gray');
6262
const [customColors, setCustomColorsState] = useState<CustomThemeColors>(DEFAULT_CUSTOM_COLORS);
6363
const [isLoading, setIsLoading] = useState(true);
6464

@@ -73,6 +73,10 @@ export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ childre
7373
const themeMode = savedTheme as ThemeMode;
7474
setThemeState(themeMode);
7575
await applyTheme(themeMode, customColors);
76+
} else {
77+
// No saved preference: apply gray as the default theme
78+
setThemeState('gray');
79+
await applyTheme('gray', customColors);
7680
}
7781

7882
// Load custom colors
@@ -181,4 +185,4 @@ export const useThemeContext = () => {
181185
throw new Error('useThemeContext must be used within a ThemeProvider');
182186
}
183187
return context;
184-
};
188+
};

0 commit comments

Comments
 (0)