Skip to content

zachleat/async-css-loading

Repository files navigation

async-css-loading

Current state of the art is filamentgroup/loadCSS. Every other individual test below has major limitations in at least one modern browser.

Default (always blocks)

Link in <body>

  • <link> in middle of <body>
  • <link> at the end of <body>

Related Chromium issue: #481122 Allow the page to render before <link> tags in body

Attribute toggle using JavaScript

JavaScript created <link>

For browsers obeying the HTML5 specification, these should not block render.

  • document.createElement("link") in <body>
  • document.createElement("link") in <head>

Related WebKit issue: #88869 renderer should not block on script-inserted stylesheets

Extra

Dependencies

Uses a styles.php to add a sleep() call to the stylesheet so that it loads slower.

Prior Art

About

Test cases for asynchronous css loading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published