DEV Community


Discussion on: Don't Trust the Cascade - Why I write CSS in JavaScript

nepeckman profile image

This means the user ends up downloading fewer bytes of code and will have a quicker time to first paint. Great success.

I haven't done the benchmarks, but I feel like there's no way CSS-in-JS can be as quick as server rendered CSS. I'm not knocking the organizational benefits of CSS-in-JS, I love component architecture and am onboard with keeping related code in a central location. But from a performance standpoint, introducing a JavaScript step into the styling process seems like pure overhead. If there are any benchmarks on this, I'd love to see them.