banyudu / tailwind-merge

Merge Tailwind CSS classes without style conflicts

Home Page:https://npmjs.com/package/tailwind-merge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tailwind-merge

Utility function to efficiently merge Tailwind CSS classes in JS without style conflicts.

import { twMerge } from 'tailwind-merge'

twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
// → 'hover:bg-dark-red p-3 bg-[#B91C1C]'

Get started

About

Merge Tailwind CSS classes without style conflicts

https://npmjs.com/package/tailwind-merge

License:MIT License


Languages

Language:TypeScript 95.9%Language:JavaScript 4.1%