Home

Awesome

A Journey toward better style

Acknowledgment

Date

Online version

CSS-in-JS comparison

We started looking for the best styling solution available. Nathan Marks built a custom solution for the needs of Material-UI: stylishly. Ultimately we reverted. We think that it's much better to rely on the community. Still, that was a very valuable experimentation.

Regarding the community, looking at the MicheleBertoli's repository. You can tell that there is a lot a solution available.

What's the best one for our needs?

For the sake of this presentation, I have selected 5 libraries that I think have taken valuable tradeoffs. I'm gonna give my point of view in the rest of this section. The information given are biased by my understanding of the reality.

Interesting dimensions

We can't compare anything without some dimensions. But having too much of them add noise.

:warning: Be aware that horse transportation is better than cars when following biased dimensions. I have sorted them by importance.

Results

CSS modulesAphroditestyled-componentsJSSFela
API--+o+++
Time to first paint++o-+o
Library size in kB~018126229
Server Rendering+o-++o
Unbiasedoo-++
Debug-oo+-
CSS output sizeo++++o

Going forward

Material-UI has chosen JSS. It's addressing our unique needs. Your needs are most likely different. It could be better for you to use a another solution. Be sure you make an informed choice :bulb:.

The compared libraries are going to improve. My comparison might not worth anything one year from now.