Next.js Discord

Discord Forum

Why my local fonts are not loading?

Unanswered
Brown bear posted this in #help-forum
Open in Discord
Brown bearOP
In my global.css I have :

@font-face {
  font-family: Avenir;
  src: url("/fonts/Avenir.ttf") format("ttf");

  font-weight: 400;
  font-style: normal;
  /* font-display: swap; */
}


I import my global.css in my layout.js file

import "./globals.css";
import NextAuthProvider from "./providers/next_auth_provider";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>


And similarly in my global.css I have :

body {
 
  background-color: black;
  font-family: Avenir; 

}

But its not loading, my font is not my custom font.

What am I doing wrong here?

0 Replies