File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/next/src/next-devtools/dev-overlay/components Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ export function ShadowPortal({ children }: { children: React.ReactNode }) {
37
37
if ( portalNode . current . shadowRoot === null ) {
38
38
shadowNode . current = portalNode . current . attachShadow ( { mode : 'open' } )
39
39
40
+ // Storybook injects the Tailwind style tag from .storybook/main.ts on each load.
41
+ // When navigating to a different story, the injected style tag is removed within the iframe.
42
+ // To re-inject the style tag, we need to call `unuse()` since the `use()` function only runs
43
+ // once unless unused.
44
+ if ( process . env . STORYBOOK ) {
45
+ tailwindCss . unuse ( )
46
+ }
47
+
40
48
// Injecting Tailwind to the Shadow DOM with Webpack style-loader.
41
49
// The target is passed to the next-devtools-inject-tailwind.js file which runs on the browser.
42
50
// x-ref: https://webpack.js.org/loaders/style-loader/#lazystyletag
You can’t perform that action at this time.
0 commit comments