From b7b4ccd2065f17befed58256c513aa188fc708b7 Mon Sep 17 00:00:00 2001 From: Taesung Hwang Date: Thu, 5 Oct 2023 13:22:56 -0700 Subject: [PATCH] Replace `FontProvider` with CSS variable on `html` - Since `FontProvider` relies on `styled-jsx` which is client-only, inject the `--next-font` variable to `RootLayout`'s `html` element which maintains compatibility with Bootstrap's reboot --- apps/site/src/app/layout.tsx | 12 ++++++++---- apps/site/src/lib/FontProvider.tsx | 20 -------------------- 2 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 apps/site/src/lib/FontProvider.tsx diff --git a/apps/site/src/app/layout.tsx b/apps/site/src/app/layout.tsx index ebda763b..f4352cfe 100644 --- a/apps/site/src/app/layout.tsx +++ b/apps/site/src/app/layout.tsx @@ -1,6 +1,5 @@ import type { Metadata } from "next"; - -import FontProvider from "@/lib/FontProvider"; +import { Fuzzy_Bubbles } from "next/font/google"; import NavBar from "@/components/NavBar/NavBar"; import Footer from "@/components/Footer/Footer"; @@ -12,14 +11,19 @@ export const metadata: Metadata = { description: "Hack at UCI's premier hackathon for beginners at UCI", }; +const fuzzy = Fuzzy_Bubbles({ + weight: ["400", "700"], + subsets: ["latin"], + variable: "--next-font-fuzzy-bubbles", +}); + export default function RootLayout({ children, }: { children: React.ReactNode; }) { return ( - - +
{children}
diff --git a/apps/site/src/lib/FontProvider.tsx b/apps/site/src/lib/FontProvider.tsx deleted file mode 100644 index e03d9e69..00000000 --- a/apps/site/src/lib/FontProvider.tsx +++ /dev/null @@ -1,20 +0,0 @@ -"use client"; - -import { Fuzzy_Bubbles } from "next/font/google"; - -const fuzzy = Fuzzy_Bubbles({ - weight: ["400", "700"], - subsets: ["latin"], -}); - -export default function FontProvider() { - return ( - - ); -}