Tailwind UI component classes #10897
jasongitmail
started this conversation in
General
Replies: 2 comments
-
Tailwind generally advocates avoiding using |
Beta Was this translation helpful? Give feedback.
0 replies
-
That makes sense as a TailwindCSS recommendation, because it's not a component library. But for a component library like TailwindUI, it has the downside that if you customize the component styles, it's unclear what styles are from the component library vs your own, making debugging harder. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really like Daisy UI's approach to component classes, such
.btn
. These classes can be overridden with Tailwind CSS classes when prototyping, or using@apply
directives like.btn { @apply text-bold pt-12... }
.The benefit is that code is DRYer and it reduces changes of component instances differing slightly from how the same component is used elsewhere, unless intentional. Developers can customize this using
@apply
directives to create a custom component system.Question:
Has Tailwind UI considered using component classes in this manner? If not, are there downsides to this approach?
Beta Was this translation helpful? Give feedback.
All reactions