Skip to content

Commit c647455

Browse files
committed
style: added Inter font for use with Tailwind UI
1 parent 46eec85 commit c647455

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

src/pages/_document.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import Document, {
3+
Html,
4+
Head,
5+
Main,
6+
NextScript,
7+
DocumentContext,
8+
DocumentInitialProps,
9+
} from 'next/document';
10+
11+
class MyDocument extends Document {
12+
static async getInitialProps(
13+
ctx: DocumentContext
14+
): Promise<DocumentInitialProps> {
15+
const initialProps = await Document.getInitialProps(ctx);
16+
17+
return initialProps;
18+
}
19+
20+
render(): JSX.Element {
21+
return (
22+
<Html>
23+
<Head>
24+
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
25+
</Head>
26+
<body>
27+
<Main />
28+
<NextScript />
29+
</body>
30+
</Html>
31+
);
32+
}
33+
}
34+
35+
export default MyDocument;

tailwind.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
/* eslint-disable */
2+
const defaultTheme = require('tailwindcss/defaultTheme');
3+
24
module.exports = {
35
purge: ['./pages/**/*.{ts,tsx}', './components/**/*.{ts,tsx}'],
46
theme: {
5-
extend: {},
7+
extend: {
8+
fontFamily: {
9+
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
10+
},
11+
},
612
},
713
variants: {},
814
plugins: [

0 commit comments

Comments
 (0)