mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-17 16:05:33 -04:00
refactor font preloading
This commit is contained in:
@@ -13,13 +13,9 @@ import comicNeueLatin700ItalicWoff2 from "@fontsource/comic-neue/files/comic-neu
|
||||
export const name = {
|
||||
regular: "Comic Neue",
|
||||
};
|
||||
export const preloadFonts = [
|
||||
{
|
||||
key: "comic-neue-700",
|
||||
src: comicNeueLatin700NormalWoff2,
|
||||
type: "font/woff2",
|
||||
},
|
||||
];
|
||||
|
||||
export const preloads = [];
|
||||
|
||||
export const family: AtRule.FontFace[] = [
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
|
@@ -15,14 +15,15 @@ export const name = {
|
||||
regular: "Inter",
|
||||
variable: "Inter var",
|
||||
};
|
||||
// re-export hashed URL(s) of the most prominent file so we can preload it in head:
|
||||
export const preloadFonts = [
|
||||
|
||||
// re-export hashed URL(s) of the most prominent files so we can preload them in `<head>` (see pages/_document.tsx):
|
||||
export const preloads = [
|
||||
{
|
||||
key: "inter-var",
|
||||
src: interLatinVarFullNormalWoff2,
|
||||
href: interLatinVarFullNormalWoff2,
|
||||
type: "font/woff2",
|
||||
},
|
||||
];
|
||||
|
||||
export const family: AtRule.FontFace[] = [
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
|
@@ -22,14 +22,15 @@ export const name = {
|
||||
regular: "Roboto Mono",
|
||||
variable: "Roboto Mono var",
|
||||
};
|
||||
// re-export hashed URL(s) of the most prominent file so we can preload it in head:
|
||||
export const preloadFonts = [
|
||||
|
||||
// re-export hashed URL(s) of the most prominent files so we can preload them in `<head>` (see pages/_document.tsx):
|
||||
export const preloads = [
|
||||
{
|
||||
key: "roboto-mono-var",
|
||||
src: robotoMonoLatinVarWghtOnlyNormalWoff2,
|
||||
href: robotoMonoLatinVarWghtOnlyNormalWoff2,
|
||||
type: "font/woff2",
|
||||
},
|
||||
];
|
||||
|
||||
export const family: AtRule.FontFace[] = [
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
|
Reference in New Issue
Block a user