Skip to content

perf: self-host Open Sans instead of loading from Google Fonts - #176

Merged
magnus-madsen merged 1 commit into
masterfrom
self-host-open-sans
Aug 3, 2026
Merged

perf: self-host Open Sans instead of loading from Google Fonts#176
magnus-madsen merged 1 commit into
masterfrom
self-host-open-sans

Conversation

@magnus-madsen

Copy link
Copy Markdown
Member

Summary

  • Replace the Google Fonts <link> tags (two preconnects + stylesheet) in Layout.astro with the @fontsource/open-sans npm package, bundled by Astro the same way Bootstrap already is
  • Weight 400 only, matching what the Google Fonts URL served, so rendering is unchanged

Details

  • Fontsource ships the same unicode-range subsets Google serves, so browsers still download only the subset they need (latin is ~16 KB woff2), now from flix.dev itself
  • font-display: swap is preserved
  • Removes the last third-party request from the site: no DNS/TLS round-trip to two Google domains, and visitors' IPs are no longer sent to Google (GDPR)
  • Verified: dist/ contains the hashed .woff2 files and zero references to fonts.googleapis.com / fonts.gstatic.com after npm run build

🤖 Generated with Claude Code

Replace the Google Fonts stylesheet and preconnect links with the
@fontsource/open-sans package, bundled by Astro like Bootstrap already
is. Same unicode-range subsetting, so download size is unchanged, but
pages no longer contact fonts.googleapis.com / fonts.gstatic.com.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@magnus-madsen
magnus-madsen merged commit af033f8 into master Aug 3, 2026
2 checks passed
@magnus-madsen
magnus-madsen deleted the self-host-open-sans branch August 3, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant