Performance: Color contrast considerations
Color contrast affects visual clarity and accessibility, impacting user experience and perceived page quality.
<button class="btn btn-primary text-white">Click me</button>
<button class="btn btn-primary" style="color: #777; background-color: #007bff;">Click me</button>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Low contrast text on colored background | Minimal | 0 | High (due to user zoom/adjustments) | [X] Bad |
| High contrast text using Bootstrap utility classes | Minimal | 0 | Low | [OK] Good |
text-light applies light-colored text suitable for dark backgrounds.text-light for readable text [OK]text-dark on dark backgroundsclass="bg-primary text-white" on a button in Bootstrap?bg-primary applies a blue background, and text-white applies white text color.class="bg-warning text-warning" to a Bootstrap alert. What is the problem?bg-warning and text-warning apply the same yellowish color to background and text.text-warning is invalidbg-light gives a light gray background, and text-dark applies dark text color.Pass the test and this pattern moves unknown