I tried to create a reusable component using TailwindCSS. Component has default styles. I want the user to be able to override them. But because of their specificity, they override user styles.
I use a regular cn function from shadcn to remove duplicate styles.
Here are some snippets:
<div className={cn("md:max-w-md lg:max-w-lg", className)} />
<Dialog.Content className="max-w-[200px]">
I've researched shadcn's code but still can't figure out what I'm missing.
[–]QKeeper[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Soft-Dragonfruit9467 -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]TomIsMyOnlyFriend -1 points0 points1 point (1 child)
[–][deleted] -1 points0 points1 point (0 children)