layers priority
#19225
Replies: 1 comment 1 reply
-
|
I don't understand why you want to swap the components and utilities layers. First of all, in your UI package, the components should be built in such a way that the UI package itself either doesn't use CSS at all or doesn't rely on it heavily - after all, the strength of TailwindCSS lies in inline HTML class definitions. See: Related for
Here are a few examples where using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
we're developing a front end UI framework using tailwind 4 and angular.
currently we're using tailwind
^4.1.14".we're using the
@utilityto create new classes for the framework and use it all over the components.there are some base classes that we decide to use
@utilityfor it and use it for components.then i need to use
@layer componentsto override the utility classes so if the user wants to override our styles they can do it simply by giving the element tailwind classes which is not possible.let me give an example to make this clear.
I create a
@utility brownand use it for some variants of components.in a specific component i need to override
@apply brownwith something else ( which already has@apply brownin it ).if i use a custom layer or use
!importantit'll override it BUT the user which is using this specific component can not override it and give another color to it unless they use!important.i tries this too :
which at the end user had to give the classes using
important.what could help me is something like
@layer user-classeswhich are still tailwind classes and comes after@layer componentsBeta Was this translation helpful? Give feedback.
All reactions