From 636c7afa00bcd4f87968c85bc3b32de921ad7d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fukan=20=C3=87avu=C5=9F?= <38227845+dgknca@users.noreply.github.com> Date: Fri, 27 Jan 2023 11:50:01 +0300 Subject: [PATCH] fix: add `display: 'swap'` for fonts (#21) --- apps/www/app/layout.tsx | 1 + apps/www/components/fonts.tsx | 2 ++ templates/next-template/pages/_app.tsx | 1 + 3 files changed, 4 insertions(+) diff --git a/apps/www/app/layout.tsx b/apps/www/app/layout.tsx index 2e4e2b274c1..aef39ac04e3 100644 --- a/apps/www/app/layout.tsx +++ b/apps/www/app/layout.tsx @@ -11,6 +11,7 @@ import { ThemeProvider } from "@/components/theme-provider" const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", + display: 'swap', }) interface RootLayoutProps { diff --git a/apps/www/components/fonts.tsx b/apps/www/components/fonts.tsx index 38fe777d660..b7305c6ae8e 100644 --- a/apps/www/components/fonts.tsx +++ b/apps/www/components/fonts.tsx @@ -8,11 +8,13 @@ import { const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", + display: 'swap', }) const fontMono = FontMono({ subsets: ["latin"], variable: "--font-mono", + display: 'swap', }) export function Fonts() { diff --git a/templates/next-template/pages/_app.tsx b/templates/next-template/pages/_app.tsx index 934085fe9e9..9166e201e81 100644 --- a/templates/next-template/pages/_app.tsx +++ b/templates/next-template/pages/_app.tsx @@ -7,6 +7,7 @@ import "@/styles/globals.css" const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", + display: 'swap', }) export default function App({ Component, pageProps }: AppProps) {