fix: preloads
All checks were successful
Build and Deploy Staging / build_and_deploy (pull_request) Successful in 1m22s

This commit is contained in:
Devin Haska 2025-05-29 22:11:12 -07:00
parent 1166807df3
commit c9d914d3e1
Signed by: wonderfulfrog
SSH key fingerprint: SHA256:ejOGyH9064rJiikox4ykOHLeuUg1f9l8wmJxs+MzNw0
3 changed files with 2 additions and 53 deletions

View file

@ -1 +0,0 @@
export const ASSETS_FONTS_PATH = "/assets/fonts";

View file

@ -1,38 +0,0 @@
export default {
display: {
family: "Atikinson Hyperlegible Next",
format: "woff2",
styles: {
Regular: {
path: "/hyperlegible/AtkinsonHyperlegibleNextVF-Variable.woff2",
fontStyle: "normal",
fontWeight: "125 950",
fontStretch: "75% 125%",
},
},
},
body: {
family: "Atikinson Hyperlegible Next",
format: "woff2",
styles: {
Regular: {
path: "/hyperlegible/AtkinsonHyperlegibleNextVF-Variable.woff2",
fontStyle: "normal",
fontWeight: "125 950",
fontStretch: "75% 125%",
},
},
},
monospace: {
family: "Atikinson Hyperlegible Mono",
format: "woff2",
styles: {
Regular: {
path: "/hyperlegible-mono/AtkinsonHyperlegibleMonoVF-Variable.woff2",
fontStyle: "normal",
fontWeight: "125 950",
fontStretch: "75% 125%",
},
},
},
};

View file

@ -1,24 +1,12 @@
import path from "path";
import { ASSETS_FONTS_PATH } from "../../config/constants/paths.js";
import fonts from "../../config/design-tokens/fonts.js";
const getFontUrl = (src) => path.join(ASSETS_FONTS_PATH, src);
const preloads = [ const preloads = [
{ {
as: "font", as: "font",
href: getFontUrl(fonts.display.styles.Regular.path), href: "/assets/fonts/hyperlegible/AtkinsonHyperlegibleNextVF-Variable.woff2",
crossorigin: true, crossorigin: true,
}, },
{ {
as: "font", as: "font",
href: getFontUrl(fonts.body.styles.Regular.path), href: "/assets/fonts/hyperlegible-mono/AtkinsonHyperlegibleMonoVF-Variable.woff2",
crossorigin: true,
},
{
as: "font",
href: getFontUrl(fonts.monospace.styles.Regular.path),
crossorigin: true, crossorigin: true,
}, },
]; ];