attempt to make css loading asynchronous

This commit is contained in:
Michael Q Larson
2015-03-07 00:36:17 -08:00
parent 687eb6c477
commit 43c729d288
4 changed files with 24 additions and 1 deletions

View File

@ -3,7 +3,6 @@
@import "lib/ionicons/ionicons";
@import "lib/animate.min.less";
@import "lib/bootstrap/variables";
@import "lib/font-awesome-4.3.0/less/font-awesome";
@import url(http://fonts.googleapis.com/css?family=Lato:400);
@import url(http://fonts.googleapis.com/css?family=Inconsolata);

View File

@ -4,6 +4,7 @@ html(ng-app='profileValidation', lang='en')
include partials/universal-head
body.no-top-and-bottom-margins.full-screen-body-background
include partials/css-cdns
include partials/navbar-wide
include partials/flash
block content

View File

@ -4,6 +4,7 @@ html(ng-app='profileValidation', lang='en')
include partials/universal-head
body.top-and-bottom-margins
include partials/css-cdns
include partials/navbar-narrow
.container
include partials/flash

View File

@ -0,0 +1,22 @@
script.
var cb = function() {
var l = document.createElement('link'); l.rel = 'stylesheet';
l.href = '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css';
var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(cb);
else window.addEventListener('load', cb);
var cb = function () {
var l = document.createElement('link');
l.rel = 'stylesheet';
l.href = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css';
var h = document.getElementsByTagName('head')[0];
h.parentNode.insertBefore(l, h);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(cb);
else window.addEventListener('load', cb);