Skip to content

Commit 8665a58

Browse files
committed
🤖 fix(storybook): change default theme to dark
Changes the default Storybook theme from light to dark, affecting: - The default 'Latest' view when no mode is explicitly set - Server-side rendering (when window is undefined) - Stories when no persisted theme exists in localStorage Chromatic's explicit mode variants (dark/light) are unaffected.
1 parent 7b0e4be commit 8665a58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.storybook/preview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ const applyStorybookTheme = (mode: ThemeMode) => {
4141

4242
const syncStorybookTheme = (mode?: ThemeMode): ThemeMode => {
4343
if (typeof window === "undefined") {
44-
return mode ?? "light"; // Keep default aligned with baseline to avoid Chromatic diffs
44+
return mode ?? "dark"; // Default to dark theme
4545
}
4646

4747
const stored = window.localStorage.getItem(UI_THEME_KEY);
4848
const persisted = stored ? (JSON.parse(stored) as ThemeMode) : undefined;
49-
const resolved = mode ?? persisted ?? "light"; // Default to light for Latest when unset
49+
const resolved = mode ?? persisted ?? "dark"; // Default to dark for Latest when unset
5050
applyStorybookTheme(resolved);
5151
return resolved;
5252
};

0 commit comments

Comments
 (0)