Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

font-loading

/font-loading

Ładuje fonty webowe bez przesunięć układu przez podzbiory plików, font-display, preload wag pierwszego renderu i dopasowanie metryk czcionki zapasowej, gdy własne fonty powodują niewidoczny tekst lub skok CLS.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Ładuje fonty webowe bez przesunięć układu przez podzbiory plików, font-display, preload wag pierwszego renderu i dopasowanie metryk czcionki zapasowej, gdy własne fonty powodują niewidoczny tekst lub skok CLS.

Oryginalny opis (EN)

Load web fonts without layout shift by subsetting the file, setting font-display, preloading first-paint weights, and matching fallback metrics. Use when custom fonts cause invisible text, a flash of restyle, or a CLS spike.

Jak działa

  1. Method
  2. Signals
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 46 linii, 357 słów
Podgląd SKILL.md
---
name: font-loading
description: Load web fonts without layout shift by subsetting the file, setting font-display, preloading first-paint weights, and matching fallback metrics. Use when custom fonts cause invisible text, a flash of restyle, or a CLS spike.
---

# Font loading

Web fonts arrive after the HTML and CSS that reference them, so the browser must
choose: hide the text until the font loads, or show a fallback and reflow when
the real font swaps in. The first flashes invisible text, the second jumps the
layout. Load fonts so text is readable immediately and nothing moves when the
swap happens.

## Method

1. **Set `font-display` in every `@font-face`.** Use `swap` to show fallback
   text at once and swap later, or `optional` to skip the swap on slow
   connections. Never leave the default `block`, which hides text for the
   whole fetch.
2. **Preload the weights first paint needs.** Add
   `<link rel="preload" as="font" type="font/woff2" crossorigin>` for the one or
   two faces above the fold so the fetch starts before the CSS is even parsed.
3. **Subset to the characters you actually use.** Strip unused glyphs and
   scripts with `glyphhanger` or `pyftsubset`; a Latin-only subset can be a
   fraction of the full file. Split by script with `unicode-range` so only the
   needed subsets download.
4. **Ship woff2 and nothing else.** woff2 is the smallest format and universally
   supported. Drop woff, ttf, and eot fallbacks unless you must serve ancient
   browsers: fewer formats mean smaller CSS and one fetch per face.
5. **Match fallback metrics to kill the swap shift.** Set `size-adjust`,
   `ascent-override`, and `descent-override` on a fallback `@font-face`,
   or use a tool like Fontaine, so the fallback fills the same space and
   the swap does not move text.
6. **Self-host instead of a third-party origin.** Serving fonts from your own
   domain removes a cross-origin connection and DNS lookup from the critical
   path and avoids a render-blocking request to a font CDN.

## Signals

- Is text visible during the font load rather than blank?
- Are first-paint fonts preloaded, so the fetch is not discovered late?
- Does the shipped file carry only the glyphs the site uses?
- Does the fallback-to-webfont swap leave the layout unmoved?

## Boundaries

The layout-shift metric this feeds is web-vitals' CLS; right-sizing images that
also shift layout is image-optimization. Variable-font axes and icon fonts carry
separate tradeoffs. Delivery caching defers to cdn-strategy.

Wersje

RepozytoriumWynikLicencja
Ta strona · Amey-Thakur/AI-SKILLS90MIT
thedaviddias/front-end-checklist100MIT

Migawka bazy z 13.11.2026 · wersja paczki 0bc4e7edf6d7 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90fe-fonts
    Wczytuje czcionki internetowe szybko i bez przesunięć układu, z WOFF2, właściwym preloadem, podzbiorami i zapasowymi czcionkami.
  • 100font-loading-stinger
    Naprawia wydajność ładowania fontów webowych: FOIT i FOUT, preload, subsetting, zapasowe fonty dopasowane metrykami i CLS przy zamianie fontu.
  • 100fonts
    Zbiera wiedzę o zarządzaniu fontami: next/font, self-hosting, pobieranie, licencje i fonty zmienne, przy konfiguracji fontów w Next.js i optymalizacji ich ładowania.
  • 100nextjs-optimization
    Optymalizuje obrazy, fonty, skrypty i metadane w Next.js pod wydajność i Core Web Vitals: next/image dla LCP, next/font bez przesunięć układu, next/script i generateMetadata.
  • 100fonts
    Konfiguruje fonty webowe przez Fonts API w Astro i dobiera zestawienia krojów: dostawcę, grubości, preloading i integrację z Tailwind.
  • 100web-vitals-analyzer
    Analizuje i optymalizuje Core Web Vitals (LCP, CLS, INP) i wydajność frontendu: szybkość stron, przesunięcia układu, raporty Lighthouse, rozmiar bundla, obrazy, fonty i zasoby blokujące render.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.