Skip to content

Instantly share code, notes, and snippets.

@sebiweise
Created April 22, 2022 13:27
Show Gist options
  • Save sebiweise/486d41d9750c641e9a3512474383defa to your computer and use it in GitHub Desktop.
Save sebiweise/486d41d9750c641e9a3512474383defa to your computer and use it in GitHub Desktop.
Next.js & TailwindUI insert Inter font family
import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}
render() {
return (
<Html lang="de" className="h-full">
<Head>
<link
href="https://rsms.me/inter/inter.css"
rel="stylesheet"
/>
</Head>
<body className="h-full">
<Main />
<NextScript />
</body>
</Html>
)
}
}
export default MyDocument
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
theme: {
extend: {
fontFamily: {
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
},
},
},
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment