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

Prevent FOUC in the iframe while loading #339

Merged
merged 1 commit into from Apr 15, 2022
Merged

Prevent FOUC in the iframe while loading #339

merged 1 commit into from Apr 15, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Apr 15, 2022

Vite 2.9+ exhibit a flash of unstyled content in the head while the page loads in.

This approach adds some styles from https://github.com/yannbf/mealdrop/blob/feat/lazy-compilation/.storybook/preview-head.html into the head, after vite has finished processing. This is necessary (instead of just putting the styles in the iframe html) due to vitejs/vite#6737.

With the changes here, we no longer see content like this:

image

@IanVS IanVS merged commit db26a1b into main Apr 15, 2022
@IanVS IanVS deleted the fouc branch April 15, 2022 20:11
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.

None yet

2 participants