Skip to content

cyan33/css-suspense

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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={require('./style.css')}>
  {/* this content will never load 
  until the stylesheet finishes loading */}
  <span className='big'>what up what up</span>
</Stylesheet>    

todo

  • unload styles that aren't used
  • tests etc etc

About

css loading for react

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.6%
  • HTML 6.3%
  • CSS 2.1%