Skip to content

Commit 67d70f0

Browse files
authoredAug 2, 2024··
chore: switch to next/font from fontsource (#584)
1 parent 1743c7f commit 67d70f0

File tree

4 files changed

+17
-54
lines changed

4 files changed

+17
-54
lines changed
 

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@algolia/autocomplete-theme-classic": "^1.6.3",
2020
"@analytics/segment": "^2.1.0",
2121
"@byteclaw/use-event-emitter": "^1.0.2",
22-
"@fontsource/inter": "^4.2.2",
2322
"@inkeep/widgets": "^0.2.266",
2423
"@mdx-js/loader": "^2.3.0",
2524
"@mdx-js/react": "^2.3.0",

‎pages/_app.tsx

+17-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useRouter } from "next/router";
2+
import { Inter } from "next/font/google";
23
import { ThemeProvider } from "next-themes";
34
import { useEffect } from "react";
45
import * as analytics from "../lib/analytics";
@@ -11,6 +12,8 @@ import * as gtag from "../lib/gtag";
1112
import { setClearbitPath } from "../lib/clearbit";
1213
import { useRemoteRefresh } from "next-remote-refresh/hook";
1314

15+
const inter = Inter({ subsets: ["latin"] });
16+
1417
import "../styles/index.css";
1518

1619
function App({ Component, pageProps }) {
@@ -34,18 +37,20 @@ function App({ Component, pageProps }) {
3437
}, [router.events]);
3538

3639
return (
37-
<ThemeProvider
38-
defaultTheme="light"
39-
enableSystem={false}
40-
forcedTheme={Component.forcedTheme}
41-
attribute="class"
42-
disableTransitionOnChange
43-
>
44-
<EventEmitterContext.Provider value={eventEmitter}>
45-
<Component {...pageProps} />
46-
</EventEmitterContext.Provider>
47-
{analytics.SEGMENT_WRITE_KEY && <analytics.Snippet />}
48-
</ThemeProvider>
40+
<main className={inter.className}>
41+
<ThemeProvider
42+
defaultTheme="light"
43+
enableSystem={false}
44+
forcedTheme={Component.forcedTheme}
45+
attribute="class"
46+
disableTransitionOnChange
47+
>
48+
<EventEmitterContext.Provider value={eventEmitter}>
49+
<Component {...pageProps} />
50+
</EventEmitterContext.Provider>
51+
{analytics.SEGMENT_WRITE_KEY && <analytics.Snippet />}
52+
</ThemeProvider>
53+
</main>
4954
);
5055
}
5156

‎styles/index.css

-36
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,6 @@
1010

1111
/* Your own custom utilities */
1212

13-
@font-face {
14-
font-family: "Inter";
15-
font-style: normal;
16-
font-weight: 400;
17-
font-display: block;
18-
src: url("~@fontsource/inter/files/inter-latin-400-normal.woff")
19-
format("woff");
20-
}
21-
22-
@font-face {
23-
font-family: "Inter";
24-
font-style: normal;
25-
font-weight: 500;
26-
font-display: block;
27-
src: url("~@fontsource/inter/files/inter-latin-500-normal.woff")
28-
format("woff");
29-
}
30-
31-
@font-face {
32-
font-family: "Inter";
33-
font-style: normal;
34-
font-weight: 600;
35-
font-display: block;
36-
src: url("~@fontsource/inter/files/inter-latin-600-normal.woff")
37-
format("woff");
38-
}
39-
40-
@font-face {
41-
font-family: "Inter";
42-
font-style: normal;
43-
font-weight: 700;
44-
font-display: block;
45-
src: url("~@fontsource/inter/files/inter-latin-700-normal.woff")
46-
format("woff");
47-
}
48-
4913
html {
5014
-webkit-text-size-adjust: 100%;
5115
box-sizing: border-box;

‎yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,6 @@
599599
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.2.tgz#d8bae93ac8b815b2bd7a98078cf91e2724ef11e5"
600600
integrity sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==
601601

602-
"@fontsource/inter@^4.2.2":
603-
version "4.5.15"
604-
resolved "https://registry.yarnpkg.com/@fontsource/inter/-/inter-4.5.15.tgz#eed1873d68755d3b52d6fcfcfa3493118430a512"
605-
integrity sha512-FzleM9AxZQK2nqsTDtBiY0PMEVWvnKnuu2i09+p6DHvrHsuucoV2j0tmw+kAT3L4hvsLdAIDv6MdGehsPIdT+Q==
606-
607602
"@graphql-typed-document-node/core@^3.1.1":
608603
version "3.2.0"
609604
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"

0 commit comments

Comments
 (0)
Please sign in to comment.