-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Styles are rendered inside the body, instead of the header in certain combinations using slots #6185
Comments
Thanks, there has been some changes here to prevent styles from rendering in the body. It sounds like it must have broke some other cases. Will prioritize getting this fixed. |
Hello, I have encountered exactly the same issue and was about to open the issue. I've prepared very minimal example to localize the issue, hope that will help you. https://github.com/drumsta/astro-slot-render Regards, |
@drumsta Yep, the user of |
PR up: #6196 |
Thank you so much @matthewp, |
Hi @matthewp ! Thank you for addressing the issue. Unfortunately, the issue still exist in a more complicated scenario, which is the real case in my own project. I've update the repo that you would be able reproduce the issue. https://github.com/drumsta/astro-slot-render Regards, |
Ah, sorry to hear that @drumsta. I'll take your new test case and incorporate it. Thanks for your patience, I think we're close to getting through these issues. |
What version of
astro
are you using?2.0.9
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
Since Astro version 2.0.4 something changed that causes for certain uses of slots (https://docs.astro.build/en/reference/api-reference/#astroslotsrender), the main styles (link) are rendered inside tags in the body instead of in the header. This causes page speeds problems with CLS (cumulative shift).
You can check the problem in the following repository: https://github.com/prototypa/astro-styles-in-body-with-slots
Once the build is done, the result of the html page is the following:
In that example repository you can see how
index.astro
is generated with styles incorrectly, however the pagegood.astro
resolves the styles ok, but doesn't use slots the way we used it in that demo's component: Widget.astroWe have done many tests and combinations before submitting this issue. We have not been able to resolve the issue. If you can help us please. Thank you.
PD: This problem has caused us to have the version of Astro fixed at 2.0.2. in AstroWind
Link to Minimal Reproducible Example
https://github.com/prototypa/astro-styles-in-body-with-slots
Participation
The text was updated successfully, but these errors were encountered: