Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@dotsunited/load-css-polyfill
Advanced tools
A simple polyfill for asynchronously loading non-critical CSS using link[rel=preload].
A simple polyfill for asynchronously loading non-critical CSS using
link[rel=preload]
.
Non-critical CSS can be loaded asynchronously by using
<link rel="preload" as="style">
with a onload
handler that switches
rel="preload"
to rel="stylesheet"
once the file is loaded.
<link rel="preload" href="style.css" as="style" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="style.css"></noscript>
This package provides a polyfill for browsers which don't
support link[rel=preload]
yet.
npm install @dotsunited/load-css-polyfill --save
yarn add @dotsunited/load-css-polyfill
Import the package and invoke the polyfill()
function.
import polyfill from '@dotsunited/load-css-polyfill';
polyfill();
Please note, that you should inline the script in your
<head>
.
This package is based on the technique developed by Scott Jehl as part of the loadCSS library.
Released under the MIT license.
FAQs
A simple polyfill for asynchronously loading non-critical CSS using link[rel=preload].
The npm package @dotsunited/load-css-polyfill receives a total of 42 weekly downloads. As such, @dotsunited/load-css-polyfill popularity was classified as not popular.
We found that @dotsunited/load-css-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.