Performance: Alert variants and colors
LOW IMPACT
This affects page load speed and rendering performance by adding CSS rules and DOM elements for alert colors and variants.
<div class="alert alert-danger" role="alert">Error alert</div>
<div class="alert" style="background-color: #ff0000; color: white; padding: 1rem; border-radius: 0.25rem;">Error alert</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Inline styles for alert colors | Low (few nodes) | Low (no layout changes) | High (style recalculation per element) | [X] Bad |
| Bootstrap alert classes | Low (few nodes) | Low (no layout changes) | Low (cached styles reused) | [OK] Good |