[Tailwind UI] - Providing global classes extracted via @apply
#2624
Replies: 1 comment
-
Hey @jeanmatthieud 👋 While doing so would remove some of the duplication on your HTML markup, this would most likely lead to duplication somewhere else. There is a good explanation of this starting at the 5:50 mark in this video: https://tailwindcss.com/course/composing-utilities-with-apply Of course you can personally benefit from abstracting specific elements with There are other ways to abstract away repetition (template partials, components). By the way, if you choose to use .ui-kit input {
@apply appearance-none block w-full px-3 py-2 border border-gray-300;
/* ... */
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, each component uses a lot of classes to define each type of component (inputs, labels, buttons...)
It means that if I want to change the style of the "input" for example, I need to update every page of my website.
Could you provide each UI component with global styles for reusability ?
eg.
Doing so will allow us to copy / paste the global styles once, and edit them quite easily.
Beta Was this translation helpful? Give feedback.
All reactions