Performance: Custom font integration
MEDIUM IMPACT
This affects page load speed and visual stability by controlling how fonts load and render on the page.
@font-face { font-family: 'MyFont'; src: url('/fonts/myfont.woff2') format('woff2'); font-display: swap; }@font-face { font-family: 'MyFont'; src: url('/fonts/myfont.woff2') format('woff2'); font-display: auto; }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| font-display: auto | Minimal | Multiple reflows on font swap | High paint cost due to invisible text and repaint | [X] Bad |
| font-display: swap | Minimal | Single reflow on font swap | Lower paint cost with immediate fallback text | [OK] Good |