Performance: Custom breakpoints
Custom breakpoints affect how CSS media queries load and apply styles, impacting rendering speed and layout shifts on different screen sizes.
module.exports = {
theme: {
extend: {},
screens: {
'sm': '480px',
'md': '768px',
'lg': '1024px',
'xl': '1280px',
'2xl': '1536px'
}
}
}module.exports = {
theme: {
extend: {},
screens: {
'sm': '480px',
'md': '768px',
'lg': '1024px',
'xl': '1280px',
'2xl': '1536px',
'custom': '600px',
'custom2': '900px',
'custom3': '1100px'
}
}
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Many close custom breakpoints | No change | Multiple reflows on resize | Higher paint cost due to frequent layout shifts | [X] Bad |
| Few well-spaced breakpoints | No change | Minimal reflows on resize | Lower paint cost with stable layout | [OK] Good |
tablet at 768px in tailwind.config.js?module.exports = { theme: { screens: { 'md': '640px', 'lg': '1024px', 'xl': '1280px' } } }tablet at 768px but your styles using tablet:bg-red-500 don't apply. What is the likely error?desktop at 900px. Which Tailwind class setup correctly hides the sidebar on smaller screens and shows it on desktop and larger?Pass the test and this pattern moves unknown