Adds direction variants to your Tailwind project
direction variant to your tailwind project,
bash
Yarn
yarn add tailwindcss-dir --dev
NPM
npm install tailwindcss-dir --save-dev
`
Now, setup the plugin in your Tailwind config's plugins section.
Currently the plugin doesn't offer any configuration.
`js
plugins: [
require('tailwindcss-dir')(),
],
`
Finally, you can use the plugin and add it to modules you want to use it with.
`js
variants: {
float: ['responsive', 'direction'],
margin: ['responsive', 'direction'],
padding: ['responsive', 'direction'],
},
`
Usage
The plugin adds ltr and rtl variants to your modules. With the default Tailwind configuration, you can use them like so:
`html
Hello world.
``