Код: Выделить всё
./app/fonts.ts
Код: Выделить всё
import { Montserrat, Open_Sans } from 'next/font/google'
export const montserrat = Montserrat({
subsets: ['latin'],
variable: '--font-montserrat',
display: 'swap',
});
export const open_sans = Open_Sans({
subsets: ['latin'],
variable: '--font-open-sans',
display: 'swap',
});
Код: Выделить всё
.app/page.tsx
Код: Выделить всё
import {montserrat} from "./fonts";
export default function Home() {
return (
Hello World
);
}
Код: Выделить всё
.app/globals.css
Код: Выделить всё
h1 {
font-family: "open-sans";
}
h6 {
font-family: "montserrat";
}
Я добавлю, что я был через официальную документацию, но в лучшем случае ее нет. следовать этому письму у меня не сработало.
Подробнее здесь: https://stackoverflow.com/questions/791 ... stylesheet