Performance: Bootstrap Icons library setup
This affects page load speed and rendering performance by adding external icon assets and CSS to the page.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" media="print" onload="this.media='all'"> <noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css"></noscript> <i class="bi bi-alarm"></i>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css"> <i class="bi bi-alarm"></i> <i class="bi bi-battery"></i> <i class="bi bi-calendar"></i>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full Bootstrap Icons CSS loaded normally | Minimal DOM nodes | 1 reflow after CSS load | High paint cost due to delayed styles | [X] Bad |
| Bootstrap Icons CSS deferred with media=print and onload | Minimal DOM nodes | 1 reflow after CSS load | Moderate paint cost, faster initial render | [!] OK |
| Inline SVG icons only | Slightly more DOM nodes | No reflows from CSS load | Low paint cost, immediate icon rendering | [OK] Good |
<head> tag to load before the page renders.<i> tags with classes starting with bi and the icon name.bi bi-house, used inside an <i> tag.<i class='bi bi-alarm'></i>
<i> tag with classes bi bi-alarm shows the alarm clock icon.<i class='bi bi-camera'></i>But the icon does not appear. What is the most likely reason?
<button> element with an aria-label for screen readers.<i class='bi bi-search'></i> inside the button and add Bootstrap button classes for styling.aria-label improves screen reader clarity.Pass the test and this pattern moves unknown