Skip to content

Commit b389644

Browse files
committed
use nextjs fonts module
1 parent d3ce339 commit b389644

File tree

12 files changed

+22
-259
lines changed

12 files changed

+22
-259
lines changed

app/[locale]/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pick from "lodash.pick"
2+
import { IBM_Plex_Mono, Inter } from "next/font/google"
23
import { notFound } from "next/navigation"
34
import { getMessages, setRequestLocale } from "next-intl/server"
45

@@ -14,6 +15,20 @@ import "@/styles/global.css"
1415
import { routing } from "@/i18n/routing"
1516
import { BaseLayout } from "@/layouts/BaseLayout"
1617

18+
const inter = Inter({
19+
subsets: ["latin"],
20+
display: "swap",
21+
variable: "--font-inter",
22+
preload: true,
23+
})
24+
25+
const ibmPlexMono = IBM_Plex_Mono({
26+
subsets: ["latin"],
27+
weight: ["400"],
28+
display: "swap",
29+
variable: "--font-mono",
30+
})
31+
1732
export default async function LocaleLayout({
1833
children,
1934
params: { locale },
@@ -38,7 +53,11 @@ export default async function LocaleLayout({
3853
)
3954

4055
return (
41-
<html lang={locale} suppressHydrationWarning>
56+
<html
57+
lang={locale}
58+
className={`${inter.variable} ${ibmPlexMono.variable}`}
59+
suppressHydrationWarning
60+
>
4261
<body>
4362
<Providers locale={locale} messages={messages}>
4463
<BaseLayout lastDeployLocaleTimestamp={lastDeployLocaleTimestamp}>
Binary file not shown.

public/fonts/inter/cyrillic-ext.woff2

-26.6 KB
Binary file not shown.

public/fonts/inter/cyrillic.woff2

-17.2 KB
Binary file not shown.

public/fonts/inter/greek-ext.woff2

-12.4 KB
Binary file not shown.

public/fonts/inter/greek.woff2

-22 KB
Binary file not shown.

public/fonts/inter/latin-ext.woff2

-78.1 KB
Binary file not shown.

public/fonts/inter/latin.woff2

-45.6 KB
Binary file not shown.

public/fonts/inter/vietnamese.woff2

-10.3 KB
Binary file not shown.

src/styles/fonts.css

Lines changed: 0 additions & 256 deletions
This file was deleted.

0 commit comments

Comments
 (0)