From e8b2222ae70a38cb989eb1e8420007cd2903546a Mon Sep 17 00:00:00 2001 From: Laercio Rios Date: Mon, 14 Oct 2024 21:03:01 -0300 Subject: [PATCH] feat: optimize font load --- package.json | 2 +- src/app/globals.css | 1 + src/app/layout.tsx | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f2b4e5c..3f65b36 100644 --- a/package.json +++ b/package.json @@ -36,4 +36,4 @@ "prettier": "^3.3.3", "typescript": "^5" } -} \ No newline at end of file +} diff --git a/src/app/globals.css b/src/app/globals.css index 613fee1..4623bb1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -37,6 +37,7 @@ body { color: var(--primary); -webkit-font-smoothing: antialiased; transition: all 0.2s ease-in-out; + font-display: swap; } a { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index bcdfeb0..7cc6c73 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,7 +4,11 @@ import { Space_Mono } from "next/font/google"; import "./globals.css"; -const spaceMono = Space_Mono({ weight: ["400", "700"], subsets: ["latin"] }); +const spaceMono = Space_Mono({ + weight: ["400", "700"], + subsets: ["latin"], + display: "swap", +}); export const metadata: Metadata = { title: "Laercio Rios",