Skip to content

Commit 8994bdc

Browse files
committed
perf: async-load Google Fonts to unblock rendering
Replace blocking stylesheet link with preload + onload swap. Page renders immediately with system font fallback, swaps to Inter/JetBrains Mono once loaded. Saves ~800ms on mobile FCP.
1 parent 2748e8f commit 8994bdc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/web/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@
7272
<link rel="apple-touch-icon" sizes="180x180" href="/public/apple-touch-icon.png">
7373
<link rel="preconnect" href="https://fonts.googleapis.com">
7474
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
75-
<link
75+
<link rel="preload"
7676
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap"
77-
rel="stylesheet">
77+
as="style" onload="this.onload=null;this.rel='stylesheet'">
78+
<noscript><link rel="stylesheet"
79+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap"></noscript>
7880
<style>
7981
* {
8082
margin: 0;

0 commit comments

Comments
 (0)