We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbb458c commit f198cf4Copy full SHA for f198cf4
.storybook/preview.tsx
@@ -38,6 +38,12 @@ const preview: Preview = {
38
decorators: [
39
(Story, context) => {
40
const mode = (context.globals.theme ?? "dark") as ThemeMode;
41
+
42
+ if (typeof document !== "undefined") {
43
+ document.documentElement.dataset.theme = mode;
44
+ document.documentElement.style.colorScheme = mode;
45
+ }
46
47
return (
48
<ThemeProvider>
49
<ThemeStorySync mode={mode} />
0 commit comments