Skip to content

Commit c4998ab

Browse files
Merge pull request #28 from glamsystems/claude
improve font performance
2 parents a8c5cd2 + 4a3bf47 commit c4998ab

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

src/layouts/Layout.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ import '../styles/global.css'
3939
<meta charset="UTF-8" />
4040
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
4141

42+
<!-- Font Preloads -->
43+
<link rel="preload" href="/fonts/GeistMono-Variable.woff2" as="font" type="font/woff2" crossorigin />
44+
<link rel="preload" href="/fonts/Geist-Variable.woff2" as="font" type="font/woff2" crossorigin />
45+
4246
<!-- Primary Meta -->
4347
<title>Vaults Report</title>
4448
<meta name="description" content="Open, community-curated effort to map the protocols, managers, and tooling powering vault infrastructure and onchain asset management." />

src/styles/global.css

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@
2222
font-display: swap;
2323
}
2424

25+
/* Fallback fonts with metric adjustments to minimize layout shift */
26+
@font-face {
27+
font-family: 'Geist Mono Fallback';
28+
src: local('ui-monospace'), local('SFMono-Regular'), local('Menlo'), local('Monaco'), local('Consolas');
29+
size-adjust: 100%;
30+
ascent-override: 95%;
31+
descent-override: 22%;
32+
line-gap-override: 0%;
33+
}
34+
35+
@font-face {
36+
font-family: 'Geist Sans Fallback';
37+
src: local('-apple-system'), local('BlinkMacSystemFont'), local('Segoe UI'), local('Roboto'), local('Helvetica Neue');
38+
size-adjust: 100%;
39+
ascent-override: 95%;
40+
descent-override: 22%;
41+
line-gap-override: 0%;
42+
}
43+
2544
@custom-variant dark (&:is(.dark *));
2645

2746
:root {
@@ -94,9 +113,9 @@
94113
}
95114

96115
@theme inline {
97-
--font-sans: 'Geist Mono', monospace;
98-
--font-mono: 'Geist Mono', monospace;
99-
--font-geist-sans: 'Geist Sans', sans-serif;
116+
--font-sans: 'Geist Mono', 'Geist Mono Fallback', ui-monospace, monospace;
117+
--font-mono: 'Geist Mono', 'Geist Mono Fallback', ui-monospace, monospace;
118+
--font-geist-sans: 'Geist Sans', 'Geist Sans Fallback', system-ui, sans-serif;
100119

101120
/* Zeus (dark warm gray) */
102121
--color-zeus-50: #f4f3f1;

0 commit comments

Comments
 (0)