1.0.6 • Published 3 years ago

tailwind-rtl2 v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
3 years ago

Tailwind rtl2

Tailwind CSS plugin to generate rtl variants.

Installation

npm install tailwind-rtl2 --save-dev

usage

plugins: [
    require('tailwind-rtl2'),
    // ...
],

Note

By default the rtl variant is not enabled to none of the tailwindcss utilities. To use the rtl variant add it at the end of any utility you want to use it with. You can toggle using the class direction-rtl at the parent element of your component

variants: {
    alignContent: ['responsive', 'rtl'],
    alignItems: ['responsive', 'rtl'],
    alignSelf: ['responsive', 'rtl'],
    flex: ['responsive', 'rtl'],
    flexDirection: ['responsive', 'rtl'],
    flexGrow: ['responsive', 'rtl'],
    flexShrink: ['responsive', 'rtl'],
    flexWrap: ['responsive', 'rtl'],
    float: ['responsive', 'rtl'],
    inset: ['responsive', 'rtl'],
    justifyContent: ['responsive', 'rtl'],
    justifyItems: ['responsive', 'rtl'],
    justifySelf: ['responsive', 'rtl'],
    textAlign: ['responsive', 'rtl'],
    position: ['responsive', 'rtl']
    // ...
},

This plugin generates the following utilities:

.direction-rtl {
  direction: rtl;
}

.direction-rtl .rtl\:flex-row {
  flex-direction: row;
}

.direction-rtl .rtl\:flex-row-reverse {
  flex-direction: row-reverse;
}
...

Example

<div class="mr-5 rtl:ml-5 rtl:mr-0">
    
</div>
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago