Better "plain" CSS support.
See original GitHub issueš Feature Proposal
Improve streaming render support to āejectā used scripts
and css
once they are detected, not after the whole render.
Motivation
Improve TTFB. Remove FOUC.
Example
- styled-components SSR interleave
styles
with rendering content, next hoisting them to the head before hydration (https://github.com/styled-components/styled-components/blob/c3eedbeb79621acd668e15ed2d63107528ed81c3/packages/styled-components/src/models/ServerStyleSheet.js#L58) used-styles
are doing the same for plain CSS on āused-classesā basic.
Pitch
Right now streaming support is not quite āstreamingā. It would add used styles and links only at the end, leading to a Flash Of Unstyled Content. It should be doable to emit all known chunks using a transform stream, as soon as they got discovered.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
supports - CSS: Cascading Style Sheets - MDN Web Docs
The @supports at-rule consists of a block of statements with a supports condition. The supports condition is a set of one or more...
Read more >Pure CSS
A set of small, responsive CSS modules that you can use in every web project. Ā· CSS with a minimal footprint. Ā· Your...
Read more >Best CSS Frameworks in 2022 - DEV Community ā ā
Bootstrap is the world's best CSS framework with large community support. This framework is built in HTML, SASS, and JavaScript. Currently,Ā ...
Read more >23 Best CSS Frameworks for Responsive And Lightweight ...
A collection of responsive and lightweight CSS frameworks that provide everything to build top-notch. These CSS frameworks improve overallĀ ...
Read more >14 Best CSS Frameworks/Libraries for Front-End Developers
Of course, you can choose neither and write out your plain CSS files. ... form-validation, right-to-left support, responsive embeds, and more.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @7rulnik, I am open for a better support. On my side, I will not do it, I donāt use CSS modules, so I donāt need this in the library. Feel free to work on it, I am open to it!
@neoziro I prefer to use css-in-js solutions as you said, but many people still use css-modules. Iām sure you already saw this tweet. I think it would be cool if we could extract styles with loadable-components.
You mentioned Suspense: do you expect some breaking changes? If no, so why we canāt implement interleave extracting of CSS?