Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid hiding all non-storybook body children #346

Merged
merged 1 commit into from Apr 22, 2022
Merged

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Apr 22, 2022

Fixes #343

This replaces the blunt hammer of

body > * {
  display: none !important;
}

with something a bit more nuanced, taken from the storybook default head styles.

This is only necessary until vitejs/vite#7786 is released, then we can remove the workaround and ask users to update vite in order to avoid this flash.

@IanVS
Copy link
Member Author

IanVS commented Apr 22, 2022

@eirslett @joshwooding while exploring this, I realized that the html provided to transformIndexHtml in code-generator-plugin.ts is already transformed, due to iframeMiddleware in the index.ts file. Do either of you know why it's included in code-generator-plugin.ts, given this is the case?

@joshwooding
Copy link
Collaborator

@eirslett @joshwooding while exploring this, I realized that the html provided to transformIndexHtml in code-generator-plugin.ts is already transformed, due to iframeMiddleware in the index.ts file. Do either of you know why it's included in code-generator-plugin.ts, given this is the case?

I'm not too sure 😕

@IanVS
Copy link
Member Author

IanVS commented Apr 22, 2022

Going to merge, but I'd still be curious to hear if Eirik knows the reason for this. I think we can probably remove it in a separate PR.

@IanVS IanVS merged commit 0491c33 into main Apr 22, 2022
@IanVS IanVS deleted the issue/343-hidden-body branch April 22, 2022 20:43
@eirslett
Copy link
Collaborator

I'm not sure 🤷 it's probably fine to change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] New styles from #339 cause issues for components added to body
3 participants