logoalt Hacker News

lexicalitytoday at 12:02 PM1 replyview on HN

I genuinely don't understand, why would you use `@apply text-center` instead of `text-align: center`?

Like if you're already at the point of setting up stylesheets & classes with a pre-processor why would you do that and not say use scss with some mixins for the more complex reused parts? At that point any IDE plugin that knows CSS can give you completion and your compiled sources will look a lot like the written ones in the dev tools.


Replies

woutr_betoday at 12:27 PM

Personally I wouldn't use `@apply text-center` over just `text-aligh: center;`, but I do use `@apply text-red-300` or `@apply px-2`, simply because I like the set of defaults Tailwind comes with.

I tried building my own set of defaults, but eventually decided that just using the Tailwind ones is much easier.