Performance: Max-width responsive variants
MEDIUM IMPACT
This affects how CSS rules apply at different screen widths, impacting rendering speed and layout stability during resizing.
/* Tailwind using max-width variant only */ "max-sm": "@media (max-width: 639px)", /* Usage */ max-sm\:p-2 { padding: 0.5rem; }
/* Tailwind config or CSS */ @media (min-width: 640px) { .btn { padding: 1rem; } } @media (max-width: 639px) { .btn { padding: 0.5rem; } }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using both min-width and max-width media queries | Low | Multiple reflows on resize | Medium | [X] Bad |
| Using only max-width responsive variants | Low | Single reflow on resize | Low | [OK] Good |