Merge ClassName

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

Usage

Code Editor
Copy
import { mergeClassName } from '@erudilabs/alma'

Conflict padding
Code Editor
Copy
mergeClassName("pl-2 pr-2 px-2")

From this case conflict with className padding and the result should be in below

px-2


Conflict background
Code Editor
Copy
mergeClassName("bg-white bg-black")

From this case conflict with className background and the result should be in below

bg-black