From 3d6689f68f17df25973589afe7e5df4ad1b2924e Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Thu, 21 Apr 2022 22:41:27 -0400 Subject: [PATCH] Avoid hiding all non-storybook body children --- packages/builder-vite/plugins/no-fouc.ts | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/builder-vite/plugins/no-fouc.ts b/packages/builder-vite/plugins/no-fouc.ts index 6d1e0608..f4e81160 100644 --- a/packages/builder-vite/plugins/no-fouc.ts +++ b/packages/builder-vite/plugins/no-fouc.ts @@ -21,22 +21,27 @@ export function noFouc(): Plugin { }; } +/** + * Insert default styles to hide storybook elements as the page loads until JS can + * add the official storybook default head styles and scripts. These lines are mostly + * taken from https://github.com/storybookjs/storybook/blob/next/lib/core-common/templates/base-preview-head.html#L6-L20 + */ function insertHeadStyles(html: string) { return html.replace( '', `