Skip to content

Commit 248b1e2

Browse files
ChengaDevclaude
andcommitted
Improve LCP: move Poppins to async HTML link, add google-analytics preconnect
- Remove @import from styled-component (runtime injection, created critical chain) - Consolidate Roboto + Poppins into a single async Google Fonts request in index.html - Add preconnect hint for google-analytics.com (~80ms LCP savings) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 87671bd commit 248b1e2

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

public/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@
7171
<!-- Google Fonts — load async, don't block render -->
7272
<link rel="preconnect" href="https://fonts.googleapis.com" />
7373
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
74+
<link rel="preconnect" href="https://www.google-analytics.com" />
7475
<link
7576
rel="preload"
76-
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap"
77+
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&family=Poppins:wght@400;500;600;700;800&display=swap"
7778
as="style"
7879
onload="this.rel='stylesheet'"
7980
/>
8081
<noscript>
81-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet" />
82+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&family=Poppins:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
8283
</noscript>
8384
<style>
8485
body {

src/components/Navigation.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ const Navigation = ({ currentTheme, setTheme }: NavigationProps) => {
108108
}
109109

110110
const Container = styled.div`
111-
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
112-
113111
nav {
114112
background: rgba(0, 0, 0, 0.8) !important;
115113
backdrop-filter: blur(10px);

0 commit comments

Comments
 (0)