tailwind-smart-merge
v1.0.2
Published
An extensible, config-aware alternative to tailwind-merge
Maintainers
Readme
tailwind-smart-merge
tailwind-smart-merge is a lightweight utility for intelligently merging Tailwind CSS class names. It supports variants (like hover: or md:), important modifiers (!), and plugin extensibility — without relying on a tailwind.config.js file.
It’s designed to work smoothly with Tailwind CSS v4 and above, where configuration is often inline in CSS.
Features
- Merges conflicting Tailwind class names (e.g.
p-2andp-4) - Preserves variants (
hover:bg-red-500,md:p-4) - Handles
!importantclasses (!text-black) - Supports arbitrary values (
bg-[var(--color)]) - Extendable with custom class group rules
Installation
npm install tailwind-smart-merge