In my Next 10 application, I can import global styles in _app.js
like so
import 'assets/css/app.css'
I'd like to add a print stylesheet. I know I can use a @media print { }
query to app.css
, but ideally it would be loaded as a separate file so the download priority is lower, e.g.
<link rel="stylesheet" href="/assets/css/print.css" media="print">
Is this possible using Next.js? I can't see any obvious way to control how the actual <link>
tag is rendered.
The only way I can see this might work is to have a custom bit of Webpack/file-loader configuration that matches print.css
only, which feels... less than ideal.
I have the same question as you velvetkevorkian but with the intend to use the following technique:
This will indeed lower the priority in the loading queue, prevent rendering from being blocked and finally replace the native fonts by the webfonts.
UPDATE: not ideal but for my "simple" CSS file (which only defines
font-face
) here is what I did:webfonts.css
file to the public folder<link>
inside<Head>