I wish we could have a `async` attribute like: <link rel="stylesheet" async> that would work pretty much like the type="preload" onload trick, but in this case it's backcompatible with old browsers and does not break CSP
-
-
Out of curiosity: Why is JS not an option?
1 reply 0 retweets 0 likes -
I feel like it's wrong to use JS to load CSS, or the page look broken when JS is disabled just before the CSS didn't load. What's the JS solution though?
2 replies 0 retweets 3 likes -
-
Personally I like the preload trick but you can combine it with <noscript> to support JS-less environments. If you are concerned about preload you can always fall back to just creating straight up <link> tags with JS and <noscript> as fallback.pic.twitter.com/lRllIJcEoo
1 reply 0 retweets 3 likes -
But that would not even work in today's Firefox, or any old browser, not even iOS10, Android 4.4 and it will fail with Content-Security-Policy
1 reply 0 retweets 0 likes -
That’s why I mentioned the good ol’ JS fallback (look into the Filament Group’s loadCSS). That works with older browsers (down to IE 8 I believe) and is CSP compatible :)
1 reply 0 retweets 1 like -
Right, but don't you think we need a better solution? we are not talking about IE8, but today's firefox and even the recommended solution if we only cared about Chrome breaks in CSP
1 reply 0 retweets 1 like -
Replying to @manucorporat @DasSurma and
Manu Mtz.-Almeida Retweeted Manu Mtz.-Almeida
I feel like this is not a solved problem, and should open a more discussion! yep, like this: https://twitter.com/manucorporat/status/1124294932976603138 … but... loading CSS should not be that hard
Manu Mtz.-Almeida added,
1 reply 0 retweets 4 likes -
No I agree, it’s definitely not a (well) solved problem. I think <link async> has been discussed before (
@tabatkins ?), but it’s also just the tip of the iceberg when it comes to controlling loading priorities and scheduling. It’s defo a hot-topic!2 replies 0 retweets 2 likes
The fact that all resource loading elements don't have defined async/defer/disabled behaviour is 
-
-
Replying to @slightlylate @DasSurma and
It's only getting worse sadly. The Chrome code for modulepreload is totally forked from the other preload code and supports different attributes. I'd love to see vendors focusing on consistent options for resource loading.
2 replies 0 retweets 5 likes -
HTML has not placed much premium on API surface consistency of late (internal spec consistency not withstanding). TAG review of HTML can help?
/cc @TravisLeithead@torgo0 replies 0 retweets 4 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.