Hello I'm trying to add a local font that I've downloaded to my Next.js project but I'm having trouble loading it in my project.
./src/app/layout.tsx
import localFont from 'next/font/local'
const dinround = localFont({
src: [
{
path: '../../public/fonts/DIN Round Pro/dinroundpro.otf'
}
],
variable: '--font-dinround'
})
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable} ${dinround.variable} antialiased`}>
{children}
</body>
</html>
);
}
In the Next.js docs it says to add the variables to the tailwind.config.js file but for TailwindCSS v4 there isn't a config file anymore. There's a postcss.config.mjs file but I don't think that's the same thing, So I assumed I do it in my globals.css file.
./src/styles/globals.css
@import "tailwindcss";
@plugin "daisyui" {
themes: light --default, dark;
root: ":root";
logs: true;
}
@theme {
/* ... */
}
So I'm unsure of how to add the variables that I added to the layout.tsx file in my TailwindCSS config file to use throughout my app.