1.0.6 • Published 5 years ago
tailwind-rtl2 v1.0.6
Tailwind rtl2
Tailwind CSS plugin to generate rtl variants.
Installation
npm install tailwind-rtl2 --save-devusage
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>