`tailwindcss-multi` is a Tailwind CSS plugin designed to enhance the readability and reduce the verbosity of utility class lists by introducing a `multi` directive. This directive allows developers to group multiple utility classes into a single, semicolon-delimited string, particularly useful when applying a set of styles under complex or nested variants. The current stable version is 0.4.6, indicating ongoing development and maintenance, with a focus on compatibility with newer Tailwind CSS releases. Its key differentiator lies in simplifying component markup by consolidating common utility groups, thereby making HTML cleaner and more maintainable, especially for conditional styling scenarios. It also supports Tailwind's arbitrary values within the `multi` directive.
npm install tailwindcss-multiVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install the `tailwindcss-multi` plugin in `tailwind.config.js` and use the `multi` directive in HTML to group utility classes, including those with variants and arbitrary values.
Enclose the entire value within single, double, or backtick quotes, e.g., `hover:multi-['bg-red-500;text-white']`.
Use only one type of quote for the entire value, e.g., `multi-['hover:font-bold']` or `multi-["hover:font-bold"]`.
For arbitrary CSS property-value pairs, wrap them in double brackets `[[]]` and do not add external quotes to the `multi-[...]` value.
Run `npm install tailwindcss-multi@latest` or `yarn add tailwindcss-multi@latest`.
Wrap the value containing the colon in quotes, e.g., `<div class="hover:multi-['bg-red-500;text-white']">...</div>`.
Use a single, consistent quote type for the entire value, e.g., `<div class="multi-['hover:font-bold']">...</div>` or `<div class='multi-["hover:font-bold"]'>...</div>`.
Ensure `module.exports = { plugins: [require('tailwindcss-multi')] }` is correctly configured in your `tailwind.config.js` file and that `tailwindcss-multi` is installed and up-to-date.