0
0
Tailwindmarkup~10 mins

Custom breakpoints in Tailwind - Browser Rendering Trace

Choose your learning style9 modes available
Render Flow - Custom breakpoints
Read tailwind.config.js
Parse custom screens
Generate CSS media queries
Apply media queries to classes
Browser evaluates viewport width
Activate matching styles
Render updated layout
Tailwind reads the custom breakpoints from the config file, creates CSS media queries, and applies styles when the browser viewport matches those breakpoints.
Render Steps - 4 Steps
Code Added:Default background color: bg-blue-500
Before
[__________]
|          |
|          |
|          |
|__________|
After
[██████████]
|          |
|          |
|          |
|__________|
The box has a blue background by default on all screen sizes.
🔧 Browser Action:Paint background color blue
Code Sample
A box changes background color at custom screen widths: blue by default, green at 480px, yellow at 768px, and red at 1024px.
Tailwind
<div class="bg-blue-500 sm:bg-green-500 md:bg-yellow-500 lg:bg-red-500">
  Responsive Box
</div>
Tailwind
/* tailwind.config.js snippet */
module.exports = {
  theme: {
    extend: {},
    screens: {
      'sm': '480px',
      'md': '768px',
      'lg': '1024px',
      'xl': '1280px',
      '2xl': '1536px',
    },
  },
};
Render Quiz - 3 Questions
Test your understanding
After applying step 3, what background color does the box have when viewport width is 800px?
AYellow
BGreen
CBlue
DRed
Common Confusions - 3 Topics
Why doesn't my style change at the expected screen width?
The custom breakpoint might be set to a different min-width than you expect. Check your tailwind.config.js to confirm the exact pixel value for the breakpoint.
💡 Remember: styles apply only when viewport width is equal or greater than the breakpoint min-width (see render_steps 2-4).
Why do styles for larger breakpoints override smaller ones?
CSS media queries cascade, so styles for bigger breakpoints override smaller ones if both apply. This is why at 1024px, lg styles override md and sm.
💡 Think of breakpoints as layers: bigger screen styles sit on top of smaller screen styles (see render_steps 3 and 4).
Can I use custom breakpoint names other than sm, md, lg?
Yes! Tailwind lets you name breakpoints anything you want in the config file, but you must use those exact names in your class names.
💡 Custom names must match exactly in your HTML classes and config (see render_flow).
Property Reference
Breakpoint NameMin WidthCSS Media QueryVisual EffectCommon Use
sm480px@media (min-width: 480px)Apply styles at small screensPhones in landscape or small tablets
md768px@media (min-width: 768px)Apply styles at medium screensTablets and small laptops
lg1024px@media (min-width: 1024px)Apply styles at large screensDesktops and larger devices
xl1280px@media (min-width: 1280px)Apply styles at extra large screensLarge desktops
2xl1536px@media (min-width: 1536px)Apply styles at very large screensVery large monitors
Concept Snapshot
Custom breakpoints in Tailwind define screen widths for responsive styles. They use min-width media queries like sm:480px, md:768px, lg:1024px. Styles inside breakpoints override smaller ones as viewport grows. Breakpoint names must match config and class names. This controls when styles activate based on screen size.