Skip to content

fix(website): load Poppins, self-hosted on our own origin - #328

Merged
danbaruka merged 1 commit into
IntersectMBO:mainfrom
IanoNjuguna:fix/poppins-font-load
Oct 16, 2026
Merged

danbaruka merged 1 commit into
IntersectMBO:mainfrom
IanoNjuguna:fix/poppins-font-load

Conversation

@IanoNjuguna

Copy link
Copy Markdown
Contributor

Description

The site asks for Poppins and loads Inter. --ifm-font-family-base has been Poppins since the design-token baseline, and the brand kit names Poppins the primary Intersect typeface, but docusaurus.config.ts requested Inter and JetBrains Mono from Google Fonts. Poppins was therefore never downloaded — headings, nav, docs and the brand kit painted in the Helvetica/Arial fallback — while Inter's faces stayed unloaded on every page, because no stylesheet, component or doc in the repo referenced Inter.

This loads Poppins and serves it from our own origin, so no page calls out to a font CDN.

What changes:

  • docusaurus.config.ts — the Google Fonts <link> is replaced by our own /fonts/fonts.css.
  • website/static/fonts/ — 16 woff2 (Poppins 300–700, JetBrains Mono 400/500/600, latin + latin-ext), the @font-face rules with unicode-ranges in fonts.css, and both OFL 1.1 licence texts.

Why the CSS is served verbatim instead of bundled: webpack inlines assets under 8 KB, which base64'd the ten Poppins files (87 KB) into the render-blocking stylesheet and defeated per-subset loading. From static/, the browser fetches only the subsets and weights a page actually renders — about 38 KB of latin Poppins for a page using all five weights, mono only where code appears.

Fixes #325

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • I have tested these changes locally
  • I have checked for broken links — the build runs with onBrokenLinks: "throw" and onBrokenAnchors: "throw", and it passes
  • Code examples have been tested — n/a, no code samples touched

Verification

  • Before, on devex.intersectmbo.org: the only font stylesheet in <head> was family=Inter…&family=JetBrains+Mono; every Inter face reported status unloaded; body text resolved through the Poppins fallback chain.
  • After, on a local production build of this branch: zero requests to fonts.googleapis.com or fonts.gstatic.com; woff2 files served from this origin; CDP platform-fonts reports Poppins-Regular / Poppins-Medium / Poppins-Bold with isCustomFont: true on body, nav, headings and /brand-kit.
  • Built output: 97 HTML pages reference Poppins, 0 reference Inter. The replacement stylesheet carries 15 Poppins @font-face blocks + 18 mono, replacing 35 Inter blocks that nothing used.
  • Coverage check: every doc and source file scanned for codepoints outside latin + latin-ext — only emoji (system-rendered either way) and punctuation inside U+2000–206F, which latin already covers.

Notes for review

  • 206 KB of font binaries are committed. Precedent: the repo already vendors image-size's dist. The alternative is bundling with hashed filenames, at the cost of the 87 KB inline above.
  • Files under static/ aren't fingerprinted, so a future font swap relies on GitHub Pages' cache TTL rather than a changed URL.
  • No rel=preload for the regular weight — deliberate scope call, easy follow-up.
  • MonthlyPulse.module.css:105 asks for weight 800, which the old loader never provided either. Left out deliberately; happy to file it as a separate issue.
  • Nothing prevents this drift class recurring (loader asks for X, CSS tokens say Y). A small check could; not added here.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my changes
  • I have made corresponding changes to the documentation — n/a
  • My changes generate no new warnings

Not touched: CSS tokens, components, pages, docs, brand-kit copy. The only source line changed is the font request.

custom.css asks for Poppins (--ifm-font-family-base) and the brand kit names
Poppins the primary Intersect typeface, but docusaurus.config.ts requested
Inter and JetBrains Mono from Google Fonts. Poppins was never downloaded, so
headings, nav, docs and the brand kit painted in the Helvetica/Arial fallback,
while Inter's faces stayed unloaded on every page — nothing in the repo
referenced it.

Serve Poppins 300-700 and JetBrains Mono 400/500/600 from
website/static/fonts instead of a font CDN: 16 woff2 files (latin + latin-ext,
the only subsets any content on the site uses) with the @font-face rules and
unicode-ranges in static/fonts/fonts.css, wired up through the existing
stylesheets field. Deliberately not run through the bundler: webpack inlines
assets under 8 KB, which base64'd the Poppins files into the render-blocking
stylesheet and defeated per-subset loading. OFL 1.1 licence texts ship beside
the fonts.

Verified on a production build: 97 pages request Poppins and none request
Inter, the Poppins woff2 files load from this origin, and
Poppins-Regular/Medium/Bold paint body, nav and heading text (CDP platform
fonts, isCustomFont true).

Refs IntersectMBO#325
@IanoNjuguna IanoNjuguna added the bug Something isn't working label Oct 14, 2026
IanoNjuguna added a commit to IanoNjuguna/developer-experience that referenced this pull request Oct 14, 2026
Cuts duplication rather than adding: section 1's per-PR table repeated the
descriptions in section 4, the review list appeared in three places, and section
3's bullets restated the summary table. Section 5 is now two sentences.

Corrects two figures: October commits are 6, not 5 (six-month total 61), and the
IntersectMBO#300 link pointed at PR IntersectMBO#328 instead of issue IntersectMBO#300. States the commit-counting
basis in section 1 now that the appendix is gone, and names why June and July
are empty — the retainer engagement started in August.
@danbaruka
danbaruka merged commit 9d7b757 into IntersectMBO:main Oct 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Site asks for Poppins but only loads Inter

2 participants