Next.js Discord

Discord Forum

Google fonts not working

Answered
Anay-208 posted this in #help-forum
Open in Discord
I saw this url to use google fonts with nextjs and add it to tailwind config. however, its not working. the font isn't working at all. https://nextjs.org/docs/pages/building-your-application/optimizing/fonts
Answered by Anay-208
I needed to add this to body element:
<body className={`${handlee.variable} ${inter.className}`}>
View full answer

3 Replies

const handlee = Handlee({
  subsets: ["latin"],
  weight: "400",
  variable: "--font-default",
});
this is all I did. I haven't used the font in body or main element
I needed to add this to body element:
<body className={`${handlee.variable} ${inter.className}`}>
Answer