Giter Club home page Giter Club logo

tailwind-bootstrap-grid's Introduction

tailwind-bootstrap-grid

npm version Build Status License: MIT

Bootstrap v5 flexbox grid system as a Tailwind CSS plugin.

Check the demo.

Installation

npm i -D tailwind-bootstrap-grid

In tailwind.js file:

module.exports = {
  plugins: [
    require('tailwind-bootstrap-grid')({
      containerMaxWidths: {
        sm: '540px',
        md: '720px',
        lg: '960px',
        xl: '1140px',
      },
    }),
  ],
};

And don't forget to include components and utilities in your tailwind base css file:

@tailwind base;
@tailwind components;
@tailwind utilities;

This will generate Bootstrap v5 flexbox grid.

* NOTE: When using the .container class from this plugin you will need to disable the core container plugin as both plugins expose a .container class.

Features & Tailwind CSS options support

  • ✅ custom screens
  • ✅ custom separator
  • ✅ custom prefix
  • ✅ important
  • ✅ rtl support

Options

  • Original Bootstrap grid's options:

    • gridColumns (default - 12) - grid size
    • gridGutterWidth (default - "1.5rem") - container and rows gutter width
    • gridGutters (default - { 0: 0 }) - gutter variable class steps (--bs-gutter-x, --bs-gutter-y)
    • containerMaxWidths (default - {}) - the max-width container value for each breakpoint
  • Extra options:

    • generateContainer (default - true) - whether to generate .container and .container-fluid classes
    • rtl (default - false) - rtl support (.offset-x classes will start responding to [dir=ltr] / [dir=rtl])
    • respectImportant (default - true) - whether it should respect the important root config option

FAQ

  1. Why my .container doesn't have padding? This plugin will not work properly with core container plugin as both plugins expose a .container class.
  2. How to use rtl css? Set the ltr or rtl dir attribute on your container (usually the root html).
  3. Is there a Bootstrap v4 grid implementation? Yes, use tailwind-bootstrap-grid@3.

Related

postcss-bootstrap-4-grid

tailwind-bootstrap-grid's People

Contributors

karolis-sh avatar dependabot[bot] avatar greenkeeper[bot] avatar mantasstikleris avatar mikouaji avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.