Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tailwind-bootstrap-grid

karolis-sh22.8kMIT5.1.0TypeScript support: included

Tailwind CSS plugin to generate Bootstrap flexbox grid system.

bootstrap, flexbox, grid, grid system, layout, rtl, tailwindcss

readme

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.

postcss-bootstrap-4-grid

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

5.1.0 (2023-11-25)

Features

5.0.1 (2022-04-17)

Bug Fixes

  • disable misleading container warning for some cases (84033c0)

5.0.0 (2022-02-20)

⚠ BREAKING CHANGES

  • drop TailwindCSS 2 support

Features

  • add TailwindCSS 3 support (95b8062)

Bug Fixes

4.0.0 (2021-05-19)

⚠ BREAKING CHANGES

  • Tailwind CSS v1 will no longer be supported.
  • Gutter class changes and removing gridGutterWidths, generateNoGutters options.

Features

  • migrate to Bootstrap 5 (ccf8882), closes #75
  • remove Tailwind CSS v1 support (2c03247)

Bug Fixes

  • deps: bump chalk, joi, lodash, reduce-css-calc (e512bd9)

3.3.0 (2021-03-04)

Features

  • add plugin scoped respectImportant support (a06f8c6)

3.2.0 (2021-03-03)

Features

  • add support for important config option (75be2c1), closes #71
  • add TailwindCSS 2 support (084772c)

3.1.0 (2020-11-04)

Features

3.0.1 (2020-11-04)

Bug Fixes

  • fix container correPlugin detection (93d476f)

3.0.0 (2020-11-04)

⚠ BREAKING CHANGES

  • now there are no defaults for container's max-width properties

Features

  • add console warning if container is generated by core plugin and the grid plugin (dc2cd27)
  • change containerMaxWidths default to {} (1d66105)

Bug Fixes

  • add missing spacings for .col-* on responsive gutters (112ed90)
  • add missing spacings for .row on responsive gutters (cc4ebb8)
  • add plugin options validation & make gridGutterWidths stricter (84b32c4)
  • reduce redundant .container-fluid styles output (e8966c5)

2.2.2 (2020-08-18)

2.2.1 (2020-08-17)

Bug Fixes

  • default gutter width when using gutters by breakpoint (e77a5ef)

2.2.0 (2020-08-17)

Features

  • responsive gutter widths (ace11e3)

Bug Fixes

2.1.0 (2019-06-06)

Bug Fixes

  • remove redundant new lines from output (703bfea)

Features

  • prefix: add custom prefix support (3f29370), closes #5

Tests

2.0.2 (2019-05-14)

Bug Fixes

2.0.0 (2019-05-14)

Features

  • tailwind: add tailwind v1 support (335b212)

Tests

BREAKING CHANGES

  • tailwind: Drop tailwind 0.x.x version support