3 ms·
In 2018 with postcss, you can have the following: .resources { @apply centered wide-margins light-bg; } And that's exactly what Tailwind is abou
by ealhad 8y ago
In 2018 with postcss, you can have the following:
.resources {
@apply centered wide-margins light-bg;
}
And that's exactly what Tailwind is about, btw!
Sadly, as you point, it's not vanilla. It works, though.
- tlrobinson 8y agoIf i'm looking at the right thing (https://github.com/pascalduez/postcss-apply https://github.com/pascalduez/postcss-apply), it looks like you can only @apply property sets in name variables, like so :root { --toolbar-theme: { background-color: rebeccapurple; color: white; border: 1px solid green; }; } .Toolbar { @apply --toolbar-theme; } Rather than arbitrary CSS classes?
- ealhad 8y agoI forgot something! Actually, this isn't the @apply I was thinking of. Tailwind comes with its own @apply: https://tailwindcss.com/docs/functions-and-directives/#apply https://tailwindcss.com/docs/functions-and-directives/#apply