Reputation: 17
I added google font "Raleway" to my Nextjs app. The fonts changed in my local server but does not show on the live environment after running npm build
.
import { Html, Head, Main, NextScript } from 'next/document';
export default function Document() {
return (
<Html>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Raleway:wght@100;200;300;400&family=Roboto:wght@100;300;400;500;700;900&display=swap"
rel="stylesheet"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
Css
html,
body {
font-family: 'Raleway', sans-serif;
}
How can I keep a consistent set of Google fonts both local and live?
Upvotes: 0
Views: 616
Reputation: 13
Google fonts sometimes don't change when your are not using internet.
Upvotes: 0