File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -231,13 +231,6 @@ export default class Beasties {
231231 */
232232 async embedLinkedStylesheet ( link : ChildNode , document : HTMLDocument ) {
233233 const href = link . getAttribute ( 'href' )
234- let media : string | undefined = link . getAttribute ( 'media' )
235-
236- if ( media && ! validateMediaQuery ( media ) ) {
237- media = undefined
238- }
239-
240- const preloadMode = this . options . preload
241234
242235 // skip filtered resources, or network resources if no filter is provided
243236 if ( ! href ?. endsWith ( '.css' ) ) {
@@ -262,6 +255,12 @@ export default class Beasties {
262255 return
263256 }
264257
258+ let media : string | undefined = link . getAttribute ( 'media' )
259+
260+ if ( media && ! validateMediaQuery ( media ) ) {
261+ media = undefined
262+ }
263+ const preloadMode = this . options . preload
265264 // CSS loader is only injected for the first sheet, then this becomes an empty string
266265 let cssLoaderPreamble
267266 = 'function $loadcss(u,m,l){(l=document.createElement(\'link\')).rel=\'stylesheet\';l.href=u;document.head.appendChild(l)}'
You can’t perform that action at this time.
0 commit comments