Skip to content

Commit d06ddad

Browse files
BrunoQuaresmajaaydenh
authored andcommitted
Toggle theme class
1 parent 04f1249 commit d06ddad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/.storybook/preview.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function withTheme(Story, context) {
139139
// theme to the HTML class list. This approach is necessary because Tailwind
140140
// CSS relies on class names to apply styles, and dynamically changing themes
141141
// requires updating the class list accordingly.
142-
document.querySelector("html")?.classList.add(selected);
142+
document.querySelector("html")?.setAttribute("class", selected);
143143

144144
return (
145145
<StrictMode>

0 commit comments

Comments
 (0)