Option to have all shadcn styles to be included the global stylesheet #9165
-
|
I noticed that with the new CLI create command, shadcnui has a stylesheet that contains some custom variants and animation keyframes (i.e. accordion). Was hoping for an option to have those added to global.css instead like with the theme tokens and other base styles instead of having a separate css import. Is that something that's planned for later? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
This is a great question and touches on the significant architectural shift happening with the shadcn/ui CLI and Tailwind CSS v4. The "separate CSS import" you are seeing is likely a result of the move towards a CSS-first configuration. As of late 2025, shadcn/ui has been transitioning to support Tailwind v4, which deprecates the The Current SituationWhen you use the new CLI commands (especially with the
While there isn't a single toggle like 1. Move Keyframes to your @theme inline {
--animate-accordion-down: accordion-down 0.2s ease-out;
--animate-accordion-up: accordion-up 0.2s ease-out;
@keyframes accordion-down {
from { height: 0; }
to { height: var(--radix-accordion-content-height); }
}
@keyframes accordion-up {
from { height: var(--radix-accordion-content-height); }
to { height: 0; }
}
}2. Consolidate Imports: If this explanation of the Tailwind v4 transition and the manual consolidation tip helped you clean up your styles, please consider marking this as the accepted answer! |
Beta Was this translation helpful? Give feedback.
This is a great question and touches on the significant architectural shift happening with the shadcn/ui CLI and Tailwind CSS v4.
The "separate CSS import" you are seeing is likely a result of the move towards a CSS-first configuration. As of late 2025, shadcn/ui has been transitioning to support Tailwind v4, which deprecates the
tailwind.config.jsfile in favor of putting theme logic directly into your CSS files using the@themedirective.The Current Situation
When you use the new CLI commands (especially with the
new-yorkstyle or the newer Registry "Blocks"), certain components that require complex animations (like the Accordion or Navigation Menu) carry specific CSS logic.tw-anima…