Title: perf: request only the font weights and styles a site uses from Google Fonts · Issue #562 · ycode/ycode · GitHub
Open Graph Title: perf: request only the font weights and styles a site uses from Google Fonts · Issue #562 · ycode/ycode
X Title: perf: request only the font weights and styles a site uses from Google Fonts · Issue #562 · ycode/ycode
Description: Summary Follow-up from #550 / #560. The inlined Google Fonts @font-face CSS requests the full variable range of each family, including axes the site never uses. On the client website the ycode-google-fonts block is 8 KB and declares Inte...
Open Graph Description: Summary Follow-up from #550 / #560. The inlined Google Fonts @font-face CSS requests the full variable range of each family, including axes the site never uses. On the client website the ycode-goog...
X Description: Summary Follow-up from #550 / #560. The inlined Google Fonts @font-face CSS requests the full variable range of each family, including axes the site never uses. On the client website the ycode-goog...
Opengraph URL: https://github.com/ycode/ycode/issues/562
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"perf: request only the font weights and styles a site uses from Google Fonts","articleBody":"## Summary\n\nFollow-up from #550 / #560. The inlined Google Fonts `@font-face` CSS requests the full variable range of each family, including axes the site never uses. On the client website the `ycode-google-fonts` block is 8 KB and declares Inter *italic* 100–900 alongside the upright range, though no layer uses italic. Each unused axis is another `@font-face` set the browser has to evaluate, and for non-variable families each becomes a separate file.\n\n## Proposal\n\n- Collect the `font-[Family]` + `font-{weight}` / `italic` classes actually used across published layers (the same scan `findLcpTextFont` in `lib/font-preload.ts` already does for the LCP heading).\n- Build the `css2` URL with only those `wght` values and drop `ital` unless an italic class is present.\n- Keep the current full-range request as the fallback when a family is only referenced through custom CSS or rich text we cannot scan.\n\n## Notes\n\n- `buildGoogleFontsUrl` in `lib/font-utils.ts` is the single place the URL is built.\n- Must not regress the preload in `getLcpFontPreloads`, which matches `@font-face` rules by family + weight.\n","author":{"url":"https://github.com/ysamcode","@type":"Person","name":"ysamcode"},"datePublished":"2026-09-17T12:22:03Z","url":"https://github.com/ycode/ycode/issues/562"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9feefc3-b52d-fcbd-aef2-559e8f065894 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DC4:285799:19BDDD:2184B0:6AFE377A |
| html-safe-nonce | 277833c2f6b9f29c8546a7e5955241a7a11a4eb2c32820ff418c925420fef00d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REM0OjI4NTc5OToxOUJEREQ6MjE4NEIwOjZBRkUzNzdBIiwidmlzaXRvcl9pZCI6Ijg3NTY5MDgzMTA3ODQ3ODQyNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0d373ff3046e0ea017607c0732a04db72bd9409e46854d0493cd02b7e6e6387 |
| hovercard-subject-tag | issue:5487277942 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ycode/ycode/562/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aaaf1aa1784d0931cf87dec950c8207c4d22c561eb8d8bb123dd5253544c2124/ycode/ycode/issues/562 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aaaf1aa1784d0931cf87dec950c8207c4d22c561eb8d8bb123dd5253544c2124/ycode/ycode/issues/562 |
| og:image:alt | Summary Follow-up from #550 / #560. The inlined Google Fonts @font-face CSS requests the full variable range of each family, including axes the site never uses. On the client website the ycode-goog... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ysamcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 260deedcf4630abb0a6b4aaa02fd2af70eab44d2529712694ceae59ca131b02e |
| turbo-cache-control | no-preview |
| go-import | github.com/ycode/ycode git https://github.com/ycode/ycode.git |
| octolytics-dimension-user_id | 65892203 |
| octolytics-dimension-user_login | ycode |
| octolytics-dimension-repository_id | 1165452593 |
| octolytics-dimension-repository_nwo | ycode/ycode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1165452593 |
| octolytics-dimension-repository_network_root_nwo | ycode/ycode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8b413ea7a9b010f4f2ebbb923b041b0d6091dd94 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width