DEV Community

Discussion on: Why Tailwind CSS

swyx profile image
swyx Author • Edited on

no point discussing performance tradeoffs without actually measuring. if you want to do a benchmark I would be happy to take a look at it and help to publicize it.

Thread Thread
giorgosk profile image
Giorgos Kontopoulos 👀 • Edited on

@swyx my point can be argued without actually measuring exact performance gain. Simple case mentioned above making it a little more concrete:

instead of multiple times adding the same tailwind classes to a card component extract the classes and use @apply them to custom class and use those in your html, after reusing card a 2nd time you already saved some of space for the html file the more you repeat the component the more you save on html space ... as simple as that.

If I get a chance I will create a demonstration but no need for performance testing.

Thread Thread
swyx profile image
swyx Author

nothing in perf is simple. how do you account for gzip of your html?

Thread Thread
giorgosk profile image
Giorgos Kontopoulos 👀

True gzip might be compressing and mitigating for all the repetition