tailwind-merge

tailwind-merge

Merge Tailwind CSS classes without style conflicts
GitHub
3.03k
Created 2 years ago, last commit 9 days ago
20 contributors
857 commits
Stars added on GitHub, month by month
9
10
11
12
1
2
3
4
5
6
7
8
2022
2023
Stars added on GitHub, per day, on average
Yesterday
+2
Last week
+4.9 /day
Last month
+5.0 /day
Package on NPM
Monthly downloads on NPM
9
10
11
12
1
2
3
4
5
6
7
8
2022
2023
No dependencies
README

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