Commit f248522
committed
🤖 fix: clear localStorage theme before Storybook loads
Added preview-head.html to clear the 'uiTheme' from localStorage before
Storybook initializes. This prevents the stored theme from overriding
the Chromatic mode theme that our decorator tries to set.
The flow is now:
1. preview-head.html clears localStorage theme
2. Storybook loads with clean slate
3. Decorator applies theme from context.globals.theme (Chromatic modes)
4. ThemeProvider respects the forcedTheme
This ensures light mode stories render in light and dark in dark.1 parent d83e9d2 commit f248522
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments