Skip to content

Commit

Permalink
Add css deffered
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthic Babu K authored and Karthic Babu K committed May 12, 2016
1 parent cb1574b commit dfd5555
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions themes/hyde-x/layouts/partials/foot.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,23 @@
ga('send', 'pageview');
</script>
{{ end }}


<noscript id="deferred-styles">
<link rel="stylesheet" type="text/css" href="style.min.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>
2 changes: 1 addition & 1 deletion themes/hyde-x/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<link rel="stylesheet" href="{{ "/css/poole-overrides.css" | absURL }}">
<link rel="stylesheet" href="{{ "/css/hyde-overrides.css" | absURL }}">
<link rel="stylesheet" href="{{ "/css/hyde-x.css" | absURL }}"> -->
<link rel="stylesheet" href="{{ "/css/style.min.css" | absURL }}"> -->
<!-- <link rel="stylesheet" href="{{ "/css/style.min.css" | absURL }}"> -->
{{ if isset .Params "highlight" }}<link rel="stylesheet" href="{{ "/css/highlight/" | absURL }}{{ .Site.Params.highlight }}.css">{{ end }}
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> -->
Expand Down

0 comments on commit dfd5555

Please sign in to comment.