fg-loadcss
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "fg-loadcss", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A function for loading CSS asynchronously", | ||
@@ -5,0 +5,0 @@ "main": "src/loadCSS.js", |
@@ -28,3 +28,3 @@ # loadCSS | ||
```html | ||
<link rel="preload" href="path/to/mystylesheet.css" as="style" onload="this.rel='stylesheet'"> | ||
<link rel="preload" href="path/to/mystylesheet.css" as="stylesheet" onload="this.rel='stylesheet'"> | ||
<noscript><link rel="stylesheet" href="path/to/mystylesheet.css"></noscript> | ||
@@ -31,0 +31,0 @@ ``` |
@@ -21,3 +21,3 @@ /*! CSS rel=preload polyfill. Depends on loadCSS function. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */ | ||
var link = links[ i ]; | ||
if( link.rel === "preload" && link.getAttribute( "as" ) === "style" ){ | ||
if( link.rel === "preload" && link.getAttribute( "as" ) === "stylesheet" ){ | ||
w.loadCSS( link.href, link ); | ||
@@ -24,0 +24,0 @@ link.rel = null; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
98738