Files
opencode/packages/ui/src/components/font.tsx
2025-12-17 10:30:03 -06:00

45 lines
1.3 KiB
TypeScript

import { Style, Link } from "@solidjs/meta"
import inter from "../assets/fonts/inter.woff2"
import ibmPlexMono from "../assets/fonts/ibm-plex-mono.woff2"
export const Font = () => {
return (
<>
<Style>{`
@font-face {
font-family: "Inter";
src: url("${inter}") format("woff2-variations");
font-display: swap;
font-style: normal;
font-weight: 100 900;
}
@font-face {
font-family: "Inter Fallback";
src: local("Arial");
size-adjust: 100%;
ascent-override: 97%;
descent-override: 25%;
line-gap-override: 1%;
}
@font-face {
font-family: "IBM Plex Mono";
src: url("${ibmPlexMono}") format("woff2-variations");
font-display: swap;
font-style: normal;
font-weight: 400 700;
}
@font-face {
font-family: "IBM Plex Mono Fallback";
src: local("Courier New");
size-adjust: 100%;
ascent-override: 97%;
descent-override: 25%;
line-gap-override: 1%;
}
`}</Style>
<Link rel="preload" href={inter} as="font" type="font/woff2" crossorigin="anonymous" />
<Link rel="preload" href={ibmPlexMono} as="font" type="font/woff2" crossorigin="anonymous" />
</>
)
}