You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a component that has its own imported css, and you import the component, the css for that component is built into its own .css file and gets injected into the body tag. This causes issues where the .css file downloads last and that component draws to the screen with no styling at first then flashes and redraws with its style.
So that counter button, this is from the basis template, has its own imported .css file. The css for that component injects into the body tag and is delievered after everything is already drawn to the screen. So that button will appear unstyled on inital loading, or renavigations back to the route its on.
Expected behavior 🤔
No response
Steps to reproduce 🕹
Steps:
Create a project
Import a compontent into a route with its own imported css
ericarthurc
changed the title
[Bug?]: Fragmented and imported css is injected into the body tag and causes html to repaint
[Bug?]: Fragmented and imported css is injected into the body tag and causes html to repaint/shift
Oct 20, 2024
Also vite cssCodeSplit: false doesn't work. The css is compiled by vite down into a single file, but the generated .html files dont reference the .css file. So the site is just completetly unstyled.
I suspect you'd have this problem even if we were manually adding removing style tags from the head.. It is less about location and mostly about timing. Vinxi is handling CSS itself so I can imagine the Vite overloads not working. We need a way to delay rendering until we know the CSS is present I think. We have a lazy route component responsible for pulling stuff in. That's where the check needs to occur I imagine.
Duplicates
Latest version
Current behavior 😯
If you have a component that has its own imported css, and you import the component, the css for that component is built into its own .css file and gets injected into the body tag. This causes issues where the .css file downloads last and that component draws to the screen with no styling at first then flashes and redraws with its style.
So that counter button, this is from the basis template, has its own imported .css file. The css for that component injects into the body tag and is delievered after everything is already drawn to the screen. So that button will appear unstyled on inital loading, or renavigations back to the route its on.
Expected behavior 🤔
No response
Steps to reproduce 🕹
Steps:
Context 🔦
No response
Your environment 🌎
The text was updated successfully, but these errors were encountered: