An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

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 loaded

api
---

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