4 ms·
Shouldn't there be a possibility for one class to extend other or to somehow include or merge classes, such that btn = rounded + shadow + p-4? This would allow
by agluszak 7y ago
Shouldn't there be a possibility for one class to extend other or to somehow include or merge classes, such that btn = rounded + shadow + p-4? This would allow you to use utility classes as building blocks for semantic ones.
(Disclaimer: I'm a backend dev and I don't know CSS well)
- iovrthoughtthis 7y agoThere is. You can create new component classes that inherit from the base classes.
- keb_ 7y agoYes, this is possible using the `@apply` directive: https://tailwindcss.com/docs/utility-first#maintainability-concerns https://tailwindcss.com/docs/utility-first#maintainability-c...
- betenoire 7y agoIMO, as soon as you do this, you may as well use some other framework. You can no longer reason atomically about the class names when you are using @apply.
- dceddia 7y agoYep, Tailwind offers the ability to create "components" that are pretty much rolled-up sets of classes like that.