Created
April 22, 2022 13:27
-
-
Save sebiweise/486d41d9750c641e9a3512474383defa to your computer and use it in GitHub Desktop.
Next.js & TailwindUI insert Inter font family
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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