Performance: Icon font usage
Icon fonts affect page load speed and rendering performance by adding font files and triggering text layout and paint.
<svg aria-hidden="true" focusable="false" width="1em" height="1em" viewBox="0 0 16 16"> <path d="M8 0L16 16H0L8 0z" fill="currentColor"/> </svg>
<link rel="stylesheet" href="https://cdn.example.com/iconfont.css"> <i class="icon-home"></i>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Icon font usage | Minimal DOM nodes | Triggers reflow per icon due to text layout | Medium paint cost for text glyphs | [!] OK |
| Inline SVG icons | Minimal DOM nodes | No reflow from font layout | Low paint cost with vector graphics | [OK] Good |
i tag with classes starting with bi to display icons.bi-alarm, so the full class is bi bi-alarm.bi and the specific icon name like bi-check.i with both classes: bi bi-check.<i class='bi bi-alarm'></i> Alarm
i tag with classes bi bi-alarm renders a scalable alarm icon before the text.<i class='bi-alarm'></i>
i tag with classes like bi bi-trash for scalable vector icons that scale well on all devices.Pass the test and this pattern moves unknown