https://github.com/threepointone/css-suspense
css loading for react
https://github.com/threepointone/css-suspense
Last synced: about 1 month ago
JSON representation
css loading for react
- Host: GitHub
- URL: https://github.com/threepointone/css-suspense
- Owner: threepointone
- Created: 2018-07-26T21:11:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-15T14:26:53.000Z (over 4 years ago)
- Last Synced: 2025-04-10T01:09:16.125Z (about 1 month ago)
- Language: JavaScript
- Size: 699 KB
- Stars: 307
- Watchers: 7
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - css-suspense
README
css-suspense
---loading css files, the suspense way.
[(what is suspense?)](https://youtu.be/nLF0n9SACd4)
requirements
---- *don't* inline css into the js bundle
- while server rendering, inline `` tags, [enabling progressive css](https://jakearchibald.com/2016/link-in-body/)
- on client side, suspend rendering till the css loads (with optional fallback ui)
- render synchronously if already loadedapi
---the api is a boring `Stylesheet` tag.
```jsx
{/* this content will not render to dom
until the stylesheet finishes loading */}
what up what up
```todo
---- unload styles that aren't used (needs `SimpleCacheProvider::invalidate`)
- tests etc etc