-
Couldn't load subscription status.
- Fork 21
Description
TailwindCSS has a directive called @apply that takes a list of utility classes and generates the CSS that it would output, so you can use a class. You can see it here:
kdl-org.github.io/src/styles/global.css
Lines 5 to 7 in 1f8369a
| .kdl-section { | |
| @apply py-10 px-2 md:px-4 prose prose-xl mx-auto; | |
| } |
However, I've heard that it is discouraged, and using the template language's component abstraction is better. Since we're using HTML (and Liquid) here, there isn't a place that is obvious to me for this component abstraction. There is Web Components, and full-fledged UI libraries like React/Vue/etc, but that all seems overkill.
For now, seems like @apply does the trick, but I wanted to open this question up to in case someone has some experience in this.