Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): do not inline global styles in HTML response #8666

Merged
merged 1 commit into from Nov 3, 2022
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

nuxt/nuxt#14953

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This reverts #7386. Rather than attempt to lazy load the entry CSS, it's safer to rely on browser fetching it in the previous (blocking) manner. We still experience the benefit of inlining SFC styles and we can reconsider entry CSS inlining in future.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Nov 3, 2022
@danielroe danielroe requested a review from pi0 November 3, 2022 17:31
@danielroe danielroe self-assigned this Nov 3, 2022
@codesandbox
Copy link

codesandbox bot commented Nov 3, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Nov 3, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit c9ba8bc
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6363faea34c9fa00080aee3a

@daguitosama
Copy link

Hi there guys, the experimental inlineSSRStyles is still present in rc-13 nuxt-config-schema, even says it's true by default on hover, but it does not do the inline at all. This is way confusing.

I think the inline is a really nice feature, and can be leaved here on the toolset as an opt-in feature.
I mean, if you have pretty much < 15 kb css in every page with Tailwindcss, why to block the render of the page awaiting the stylesheet it's fetch, when all that tiny css can be "easily" inlined in the Document Head.

Copy link
Member Author

@daguitosama At the moment, we do not inline global CSS but CSS associated with individual Vue SFCs.

@stuible
Copy link

stuible commented Nov 14, 2022

@daguitosama At the moment, we do not inline global CSS but CSS associated with individual Vue SFCs.

Is this expected to change? Some of the most critical CSS to a site (resets, grid systems, etc) is global CSS.

@danielroe
Copy link
Member Author

@stuible The global CSS is still loaded synchronously, so there will be no flash when your page loads.

@Plinpod
Copy link

Plinpod commented Jan 5, 2023

Hi there guys, the experimental inlineSSRStyles is still present in rc-13 nuxt-config-schema, even says it's true by default on hover, but it does not do the inline at all. This is way confusing.

I think the inline is a really nice feature, and can be leaved here on the toolset as an opt-in feature. I mean, if you have pretty much < 15 kb css in every page with Tailwindcss, why to block the render of the page awaiting the stylesheet it's fetch, when all that tiny css can be "easily" inlined in the Document Head.

I agree in some cases, it still makes sense to inline the global CSS. Is there a way to force this to happen in the current configuration?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants