Shadcn Errors Styling Conflicts

Use when a className override on a shadcn component does not visually take effect, when two Tailwind utility classes appear in the rendered DOM but only one applies, when a cva variant looks correct in code but the consumer className does not win, when porting code from Tailwind v3 to v4 and class semantics shift, when adding arbitrary values (bg-[#fff], size-[28px]) next to preset utilities, when the important modifier (! prefix in v3, suffix in v4) behaves unexpectedly, when a component built with cva looks unstyled or doubled-up, or when reviewing PRs that build className strings with template literals or string concatenation. Prevents the canonical class-merging bugs: skipping cn() so duplicates leak through the DOM, calling cn() inside cva (no-op since cva already runs clsx), assuming the important modifier always overrides plain utilities, mixing arbitrary properties with their preset equivalents, and applying v3-only class names in a v4 project. Covers the cn() helper rule (clsx + tailwind-merge wrappe

Impertio-Studio 848c581 4 files · 38.5 KB Updated

File contents

impertio-studio/shadcn-ui-claude-skill-package/tree/main/skills/source/shadcn-errors/shadcn-errors-styling-conflicts commit 848c5817d8

Frequently asked questions

npx skillmds@latest add impertio-studio/shadcn-errors-styling-conflicts