Tailwind CSS

Screen Width and Breakpoint ?


Tailwind CSS utilizes breakpoints to define responsiveness in your web layouts. These breakpoints represent different screen width ranges, allowing you to apply styles conditionally based on the device size.

 

Breakpoints:

Prefix

Screen min Width

sm

640px

md

768px

lg

1024px

xl

1280px

2xl

1536px

 

Customizing Breakpoints:

While Tailwind offers default breakpoints, we can customize them to fit your project's specific needs. You can achieve this by editing the theme.screens section in your tailwind.config.js file. 

 

module.exports = {
 theme: {
   screens: {
     'sm': '640px',
     'md': '768px',
     'lg': '1024px',
     'xl': '1280px',
     '2xl': '1536px',
     // Add your custom breakpoint
   }
 }
}

 

Note: We can also add new breakpoints as required in Project.