ready-state-stylesheet
1.1.1 • Public • Published ready-state-stylesheet
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)
readyStateStylesheet(stylesheetUrl, function () {
document.documentElement.classList.add('fonts-loaded')
})
License
MIT
Package Sidebar
Install
npm i ready-state-stylesheet
Weekly Downloads