ready-state-stylesheet

1.1.1 • Public • Published

ready-state-stylesheet

version MIT License Standard Standard Version Size

Load a stylesheet once the document ready state is complete to prevent blocking rendering (useful for lazy loading web fonts)

Usage

import readyStateStylesheet from 'ready-state-stylesheet'
const stylesheetUrl = 'https://fonts.googleapis.com/css?family=Roboto'
 
readyStateStylesheet(stylesheetUrl)
 
// or provide a callback
readyStateStylesheet(stylesheetUrl, function () {
  document.documentElement.classList.add('fonts-loaded')
})

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i ready-state-stylesheet

Weekly Downloads

2

Version

1.1.1

License

MIT

Last publish

Collaborators

  • danhayden