Performance: Mobile-first philosophy
HIGH IMPACT
This concept affects initial page load speed and rendering performance on mobile devices by prioritizing lightweight styles and content first.
.btn { padding: 1rem; } @media (min-width: 768px) { .btn { padding: 2rem; } }.btn { padding: 2rem; } @media (max-width: 767px) { .btn { padding: 1rem; } }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Desktop-first CSS | Same | Same | Higher due to larger CSS | [X] Bad |
| Mobile-first CSS | Same | Same | Lower due to smaller initial CSS | [OK] Good |