Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think there are two reasons:

- you can copy the classes from html directly into @apply (you need to tinker a bit more to get responsive/hover/etc classes to work, though)

- you work with predefined values, so if you switch color in tailwind.config.js, it's gonna get correct value in the @apply class too.

That's the way I see it



2. which values are you going to ever change in align-center, display-flex and text-color-white, it's not like you will change the display flex to mean display block or align center to mean align start, it will always be the same. Same with color white and 95% of other classes that tailwind uses.


For the second one, couldn’t you get the same effect by just using css variables?


Sure you can and you should, right?

But this way you have to write couple of classes more, couple of variables more. And with Tailwind you just define/change value in the config and you have all the classes generated, so the changes are minimal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: