Skip to content

Commit

Permalink
Replace FontProvider with CSS variable on html
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
taesungh committed Oct 5, 2023
1 parent bf17f58 commit b7b4ccd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
12 changes: 8 additions & 4 deletions apps/site/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 (
<html lang="en">
<FontProvider />
<html lang="en" className={fuzzy.variable}>
<body className="background">
<NavBar />
<main>{children}</main>
Expand Down
20 changes: 0 additions & 20 deletions apps/site/src/lib/FontProvider.tsx

This file was deleted.

0 comments on commit b7b4ccd

Please sign in to comment.