css-suspense

css loading for react

  • Owner: threepointone/css-suspense
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

css-suspense

loading css files, the suspense way.

(what is suspense?)

requirements

  • don't inline css into the js bundle
  • while server rendering, inline <link> tags, enabling progressive css
  • 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.

<Stylesheet href='/path/to/style.css'/>
{/* this content will not render to dom
  until the stylesheet finishes loading */}   
<span className='big'>what up what up</span>

todo

  • unload styles that aren't used (needs SimpleCacheProvider::invalidate)
  • tests etc etc

Main metrics

Overview
Name With Ownerthreepointone/css-suspense
Primary LanguageJavaScript
Program languageHTML (Language Count: 3)
Platform
License:
所有者活动
Created At2018-07-26 21:11:20
Pushed At2020-10-15 14:26:53
Last Commit At2018-08-09 23:35:50
Release Count2
Last Release Namev1.0.2 (Posted on 2018-08-09 23:35:50)
First Release Namev1.0.1 (Posted on 2018-07-27 22:44:21)
用户参与
Stargazers Count307
Watchers Count7
Fork Count14
Commits Count24
Has Issues Enabled
Issues Count2
Issue Open Count0
Pull Requests Count1
Pull Requests Open Count1
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private