[bug]: (canary version) Incorrect class generation when using a prefix in Tailwind with shadcn #6887
Open
2 tasks done
Labels
bug
Something isn't working
Describe the bug
Description
When installing a new component in shadcn using the canary version and setting a prefix in Tailwind CSS (
prefix
intailwind.config.js
), the generated classes are malformed. Instead of correctly applying the prefix before the class, shadcn incorrectly introduces additional prefixes (such asdark:
or other modifiers), resulting in invalid class names.Environment
Additional Notes
This issue causes styling conflicts and prevents the correct application of Tailwind CSS utilities. The expected behavior is that the prefix should always be applied before the class name, even when using Tailwind’s dark mode or other modifiers.
Affected component/components
all
How to reproduce
Steps to Reproduce
tailwind.config.js
, e.g.:shadcn add <component>
.Expected Behavior
The generated classes should correctly apply the prefix before the class, e.g.:
Actual Behavior
The generated classes incorrectly apply an additional prefix, leading to malformed class names, e.g.:
Instead of:
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: