Google Fonts request fails (HTTP 400) for variable fonts in font packs: `[email protected]` exceeds the fonts' axes

Aperta
#3,353 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
html
Ambito
frontend

Direzione di ricerca

Read layouts/_partials/functions/typography.html and the affected font pack definitions. Check how variable fonts are marked and how their Google Fonts URL is assembled; reproduce with the provided curl request. Done when the bundled variable fonts request valid axis ranges and the combined request no longer returns HTTP 400.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

layouts/_partials/functions/typography.html requests every font marked variable: true with [email protected]. Google Fonts returns HTTP 400 when the requested range is outside the font's weight axis, and one invalid family fails the whole combined request, so no web fonts load and sites fall back to system fonts.

Affected bundled packs (tested 2026-10-21):

  • developer: Space Grotesk (300–700), Fira Code (300–700)
  • academic: Lora, Source Serif 4
  • editorial: Playfair Display
  • humanist: Nunito, Open Sans
  • modern: JetBrains Mono (Inter alone works)

Repro: curl -I "https://fonts.googleapis.com/css2?family=Space+Grotesk:[email protected]&display=swap" gives 400; with [email protected] it gives 200.

Suggested fix: store each variable font's axis range in the font pack (e.g. axes: {heading: "300..700"}) and use it instead of 100..900, or fall back to the static weights list.

Seen on kit [email protected].

Lingua principale
HTML
Stelle
9.8k
Fork
2.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HugoBlox/kit

Tutte le issue di HugoBlox/kit

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.