How To Do Custom Container Size In Tailwind CSS

How To Do Custom Container Size In tailwind CSS

Table of Contents

Open Tailwind.config.js file And add your components and then Building your CSS

module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },

  //  custome container with
  corePlugins: {
    container: false
  },
  plugins: [
    function ({ addComponents }) {
      addComponents({
        '.container': {
          maxWidth: '100%',
          '@screen sm': {
            maxWidth: '600px',
          },
          '@screen md': {
            maxWidth: '700px',
          },
          '@screen lg': {
            maxWidth: '800px',
          },
          '@screen xl': {
            maxWidth: '900px',
          },
        }
      })
    }
    //  end



  ],
}

 

Leave a Comment

Your email address will not be published. Required fields are marked *

No data found.