Remove deferred loading of css. Causes nasty page fluidity on page changes.

This commit is contained in:
Tony Blyler 2016-11-03 16:08:27 -04:00
parent 6db1e12b76
commit ddcf6a28d0
2 changed files with 1 additions and 16 deletions

View file

@ -8,21 +8,5 @@
{{ end }}
<a href="#top">Top</a>
</div>
<noscript id="deferred-styles">
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}/css/main.css"/>
</noscript>
<script>
var loadDeferredStyles = function() {
var addStylesNode = document.getElementById("deferred-styles");
var replacement = document.createElement("div");
replacement.innerHTML = addStylesNode.textContent;
document.body.appendChild(replacement);
addStylesNode.parentElement.removeChild(addStylesNode);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(function() { window.setTimeout(loadDeferredStyles, 0); });
else window.addEventListener('load', loadDeferredStyles);
</script>
</body>
</html>

View file

@ -6,6 +6,7 @@
<title>{{ .Title }} &middot; {{ .Site.Title }}</title>
<base href="{{ .Permalink }}">
<link rel="canonical" href="{{ .Permalink }}">
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}/css/main.css" />
{{ if .RSSlink }}
<link href="{{ .RSSlink }}" rel="alternative" type="application/rss+xml" title="{{ .Title }}" />
{{ end }}