Hacker News new | past | comments | ask | show | jobs | submit login

> Probably better compression by not repeating styles everywhere

Repeating styles would be the least of the problem because of the gzip compression, no?




I suspect that if you're using React's 'style' expansion using an object, the order of styles that are written inline is going to be non-deterministic which means your compression won't be optimal. It'll still work, obviously, but not as well as the compression you'd get if you used a class name.


Correct.

I like the "Controlling File Size" of the Tailwind CSS project: https://tailwindcss.com/docs/controlling-file-size

They DO tell developers to remove unused CSS when building for production of course, but in case you ship the whole (big) default file, it goes from 2309.7K to 180.6K (Gzip) or even 43.6K (Brotli)!




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

Search: