Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/fonts/inter-latin-variable.woff2
Binary file not shown.
10 changes: 9 additions & 1 deletion src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ const fullTitle = isHome
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />

<!-- Fonts (self-hosted via @fontsource-variable to avoid CLS / third-party hop) -->
<!-- Fonts: self-hosted Inter latin subset, preloaded for above-the-fold body text.
The @font-face block lives in src/styles/global.css (font-display: optional). -->
<link
rel="preload"
as="font"
type="font/woff2"
crossorigin="anonymous"
href="/fonts/inter-latin-variable.woff2"
/>

<title>{fullTitle}</title>

Expand Down
17 changes: 16 additions & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
@import '@fontsource-variable/inter/wght.css';
@import '@fontsource-variable/jetbrains-mono/wght.css';

/*
* Inter Variable — latin subset only, self-hosted from /public/fonts/.
* Preloaded in BaseLayout.astro <head>. font-display: optional avoids any
* FOUT/CLS contribution: if the font is not ready within ~100 ms the system
* font is used and Inter only swaps in on subsequent navigations (it's
* cached by then). With the preload tag the latin subset typically beats
* that window on first paint anyway.
*/
@font-face {
font-family: 'Inter Variable';
font-style: normal;
font-display: optional;
font-weight: 100 900;
src: url('/fonts/inter-latin-variable.woff2') format('woff2-variations');
}

@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
Loading