mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-06-27 17:25:43 -04:00
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
// a weird system but makes it impossible to accidentally end up with multiple imports of the same font. see:
|
|
// https://nextjs.org/docs/pages/building-your-application/optimizing/fonts#reusing-fonts
|
|
|
|
import {
|
|
Geist as GeistSansLoader,
|
|
Geist_Mono as GeistMonoLoader,
|
|
Comic_Neue as ComicNeueLoader,
|
|
} from "next/font/google";
|
|
|
|
export const GeistSans = GeistSansLoader({
|
|
subsets: ["latin"],
|
|
display: "swap",
|
|
fallback: [
|
|
// https://github.com/system-fonts/modern-font-stacks#system-ui
|
|
"system-ui",
|
|
"sans-serif",
|
|
],
|
|
preload: true,
|
|
});
|
|
|
|
export const GeistMono = GeistMonoLoader({
|
|
subsets: ["latin"],
|
|
display: "swap",
|
|
fallback: [
|
|
// https://github.com/primer/css/blob/4113637b3bb60cad1e2dca82e70d92ad05694399/src/support/variables/typography.scss#L37
|
|
"ui-monospace",
|
|
"SFMono-Regular",
|
|
"'SF Mono'",
|
|
"Menlo",
|
|
"Consolas",
|
|
"'Liberation Mono'",
|
|
"monospace",
|
|
],
|
|
preload: true,
|
|
});
|
|
|
|
export const ComicNeue = ComicNeueLoader({
|
|
weight: ["400", "700"],
|
|
style: ["normal", "italic"],
|
|
subsets: ["latin"],
|
|
display: "swap",
|
|
fallback: ["'Comic Sans MS'", "'Comic Sans'"],
|
|
preload: false,
|
|
});
|