Adds direction (LTR, RTL) variants to your Tailwind project
Tailwind Direction adds a custom
directionvariant to your tailwind project, letting you have custom CSS rules for LTR and RTL layouts.
Note: This package requires Tailwind >= v1.0.1.
Install the package via NPM/Yarn.
# Yarn yarn add tailwindcss-dir --devNPM
npm install tailwindcss-dir --save-dev
Now, setup the plugin in your Tailwind config's
pluginssection. Currently the plugin doesn't offer any configuration.
plugins: [ require('tailwindcss-dir')(), ],
Finally, you can use the plugin and add it to modules you want to use it with.
variants: { float: ['responsive', 'direction'], margin: ['responsive', 'direction'], padding: ['responsive', 'direction'], },
The plugin adds
ltrand
rtlvariants to your modules. With the default Tailwind configuration, you can use them like so:
Hello world.
Tailwind Direction is licensed under the MIT license.