A CSS Logical Properties and Values plugin for Tailwind CSS.
The tailwindcss-logical plugin is designed to enhance Tailwind CSS by incorporating CSS Logical Properties and Values for easier development in non-LTR (left-to-right) languages. This plugin provides a solution to styling elements that need to adapt based on the reading direction of the language.
To install the tailwindcss-logical plugin, follow these steps:
Add the plugin as a dependency in your project.
npm install tailwindcss-logical
Register tailwindcss-logical in the plugins section of your Tailwind CSS configuration file.
Before Tailwind v3:
module.exports = {
plugins: [
require('tailwindcss-logical'),
],
}
Note: In Tailwind v3, adding variants to variants.logical in the configuration file is no longer necessary.
The tailwindcss-logical plugin extends Tailwind CSS to support CSS Logical Properties and Values, which simplifies styling elements for languages that are read right-to-left. By providing flow-relative values, margins, padding, and offsets, this plugin offers a more intuitive way to handle multi-directional layouts in web development. It complements Tailwind CSS v3 and above by integrating seamlessly with the existing utility classes.