-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: Script
component supports css
#93
base: main
Are you sure you want to change the base?
Conversation
I don't know what details you are talking about, but that is not what we are discussing in this PR |
@yusukebe In this example, FOUT will occur on every reload. |
@ryuapp Thanks! You are right. Even if it is raw CSS and not Tailwind CSS, the problem still occurs. I think that is, Hmmm... Unless this issue is resolved, this feature will not ship. I would like to see some good solutions... |
Possibly it's related to this: vercel/next.js#12868 |
So, does that mean embedding inlined CSS into HTML at server-side rendering time? I have thought of that method but have not implemented it. I may try it. Thanks! |
Having played around with this as well, any solution that involves only injecting the Explicitly adding the CSS link avoids this, but then you lose out on cache-busting via random CSS names. Other frameworks deal with the notion of vital CSS that is explicitly added to the DOM to build out the shell, and then the other styles are injected via JS. This is difficult because how do you determine which CSS is vital, and which isn't? I suppose one solution could be a static-named file ( |
Or, it could output a manifest and refer to it during development, but I think that would decrease the performance. |
Resolves #90
With the
Script
component in this PR, you can import CSS for both development and production easily:Then output HTML: