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 58131f2 commit 8203a3cCopy full SHA for 8203a3c
site/.storybook/preview.jsx
@@ -135,6 +135,12 @@ function withTheme(Story, context) {
135
const { themeOverride } = DecoratorHelpers.useThemeParameters();
136
const selected = themeOverride || selectedTheme || "dark";
137
138
+ // Ensure the correct theme is applied to Tailwind CSS classes by adding the
139
+ // theme to the HTML class list. This approach is necessary because Tailwind
140
+ // CSS relies on class names to apply styles, and dynamically changing themes
141
+ // requires updating the class list accordingly.
142
+ document.querySelector("html")?.classList.add(selected);
143
+
144
return (
145
<StrictMode>
146
<StyledEngineProvider injectFirst>
0 commit comments