我有一个nextjs
应用程序,我在app/layout.tsx
上应用了谷歌字体:
问题:这种字体只适用于/
,而不适用于其他页面.
layout.tsx
是不是适用于所有的子元素?
import "styles/global.css";
import {Metadata} from "next";
import {Gabarito} from "next/font/google";
const gabarito = Gabarito({
weight: ["500", "600", "700", "900"],
style: ["normal"],
display: "swap",
subsets: ["latin"],
});
export default function RootLayout({children}: {children: React.ReactNode}) {
return (
<html lang='fr' className={gabarito.className}>
<body>{children}</body>
</html>
);
}
export const metadata: Metadata = {
title: "...",
description: "...",
};