Performance: Custom breakpoints
Custom breakpoints affect how CSS media queries trigger layout changes, impacting page responsiveness and rendering speed.
@media (min-width: 576px) { ... } @media (min-width: 768px) { ... } @media (min-width: 992px) { ... } @media (min-width: 1200px) { ... }
@media (min-width: 320px) { ... } @media (min-width: 375px) { ... } @media (min-width: 425px) { ... } @media (min-width: 768px) { ... } @media (min-width: 1024px) { ... } @media (min-width: 1440px) { ... }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Many close breakpoints | No extra DOM nodes | Multiple reflows on resize | High paint cost due to frequent repaints | [X] Bad |
| Few well-spaced breakpoints | No extra DOM nodes | Minimal reflows on resize | Lower paint cost with fewer repaints | [OK] Good |
custom breakpoints in Bootstrap?$grid-breakpoints to define screen widths for breakpoints.$grid-breakpoints lets you add or change custom breakpoints.xxl?
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px );
xxl key in the mapxxl: 1400px, meaning the breakpoint starts at 1400 pixels.xxl at screen widths 1400px and above.xxl at 1400px but your styles for it are not applying. What is the most likely mistake?px for widths, missing units cause failure.@media (min-width: 1400) without units shows @media (min-width: 1400) missing px, so styles won't apply.xxxl. Which SCSS code correctly adds it and sets container max width for it?map-merge to add xxxl: 1600px to existing $grid-breakpoints.xxxl: 1540px to $container-max-widths using map-merge.map-merge, and includes units px.Pass the test and this pattern moves unknown