You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Please consider simplifying the ability to leave some critical CSS as internal CSS inside head tag:
<head>
....
<style>....</style>
</head>
For now, adding something that prevents nuxt from building the styles of a component, like ?indentedSyntax=true to the layouts/default.vue allows us to have internal css inside head.
However, we could also defer the load of the compiled _nuxt/style.css, if you set it as Google suggests here
I also copy/paste the part that I ask you to look at:
<noscript id="deferred-styles">
<link rel="stylesheet" type="text/css" href="small.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>
This feature request is available on Nuxt.js community (#c217)
The text was updated successfully, but these errors were encountered:
o-alexandrov
changed the title
Feature Suggest. Internal css and _nuxt/style.css defer loading
Feature Request. Internal css and _nuxt/style.css defer loading
Feb 14, 2017
Hi,
Please consider simplifying the ability to leave some critical CSS as internal CSS inside head tag:
For now, adding something that prevents nuxt from building the styles of a component, like ?indentedSyntax=true to the layouts/default.vue allows us to have internal css inside head.
However, we could also defer the load of the compiled _nuxt/style.css, if you set it as Google suggests here
I also copy/paste the part that I ask you to look at:
The text was updated successfully, but these errors were encountered: