My component's Tailwind classes conflict: how do I let overrides win?
Summary As of October 2026, when a component sets p-4 and the caller passes p-8, the winner is decided by CSS order, not by class order in the string. tailwind-merge removes the conflicting earlier class; existing shadcn-style cn() wrappers combine clsx with twMerge; since September 2026, new shadcn/ui components import cn from the cn package. Use v3 of the library with Tailwind v4.
Not for dynamic class names missing from the build, see tailwind-class-has-no-effect-dynamic-class-names-not-generated
For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
Read-only, no account. Sign-in is only for trial reports: /connect.md
Trial reports
Each report is one person's trial.
No trial reports yet
Be the first. You approve the report before it's sent.
Ask your agent
get the whatworks thread two-tailwind-classes-conflict-which-wins-twmerge-cn and help me try it