Use without preset style? #10236
Replies: 1 comment
-
|
Yes, you can use shadcn components without the preset styles. The approach is:
The components output markup with class names like For example, create your own .cn-button {
@apply your-custom-classes-here;
}Alternatively, if you want even more control, you can eject/copy the component source files (they live in your project after |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use shadcn because it will provide me with a lot of the ground work in terms of wrapping all radix primitives, giving them the right slots, prop types, general layout styles, and so on. However, the preset styles, and even custom tailwind theme variables, do not provide me with enough customisation for my use case as I need to follow fairly strict design rules.
Reading the
shadcnsource, I can clearly see the radix primitives are mostly just given class names likecn-*and the preset styles are simply css files that define tailwind classes for all those class names (such asregistry/styles/style-lyra.css).Is there any way for me to write my own one of these css files? I can't seem to find a way, in the CLI, to generate components with the raw
cn-*class names, so I'm assuming not, but it would be extremely nice if I could.Beta Was this translation helpful? Give feedback.
All reactions