From f85fd10b8ec5087c867941527a09b9ea6c5e18c2 Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Sat, 28 Jan 2023 17:45:51 +0300 Subject: [PATCH] improve font performance --- src/components/CustomNode/styles.tsx | 3 ++- src/pages/_app.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/CustomNode/styles.tsx b/src/components/CustomNode/styles.tsx index aa21f4b..f2ffcfc 100644 --- a/src/components/CustomNode/styles.tsx +++ b/src/components/CustomNode/styles.tsx @@ -5,7 +5,8 @@ import styled, { DefaultTheme } from "styled-components"; const robotoMono = Roboto_Mono({ weight: "500", subsets: ["latin"], - display: "auto" + display: "swap", + fallback: ["Arial, Helvetica, sans-serif", "Tahoma, Verdana, sans-serif"] }); function getTypeColor(value: string, theme: DefaultTheme) { diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index e552543..af86c53 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -14,7 +14,8 @@ import { ThemeProvider } from "styled-components"; const monaSans = localFont({ src: "./Mona-Sans.woff2", variable: "--mona-sans", - display: "auto", + display: "swap", + fallback: ["Arial, Helvetica, sans-serif", "Tahoma, Verdana, sans-serif"] }); if (process.env.NODE_ENV !== "development") {