Post

It’s a real shame that folk a decade ago weren’t warning developers against utterly insane things like CSS-in-J —  oh.

GitHub@github.com

GitHub.com has fully moved off CSS-in-JS to CSS Modules, resulting in 55% less server-side render time and 25% faster component init. https://github.blog/engineering/architecture-optimization/improving-site-performance-by-shipping-more-css/

I don't think they even have fixed the CSS-in-JS though. They aren't using native `with {type:css}` imports. This is just an extra compile tool so that developers can work with CSS, and use CSS variables instead of manipulating it, but the output is still JS.

I'd add: the CSS on the GitHub site is pretty awful. That they used AI to write most of it explains a lot (LLMs love !important)...

Keith Henry@k17.dev

Today I had to dig into GitHub's CSS - it's a mess of sub-tailwind classes with overriding !important flags everywhere, a mix of rem and px sizes, with at least 2 different naming conventions. It must be horrible to work with.

I can imagine all of the 1-pagers and RFCs written by senior engineers at medium to large organizations ten years ago, that got paid millions to make these changes. I wrote the RFC to move away from CSS in JS in a previous role undoing the damage 🫠

0 reposts1 like

Yeah, it smacks of that kind of navel-gazing over-engineering, where someone is probably proud how their proprietary design system improves on vanilla CSS by adding terse cascading styles that can be easily applied, once learnt. And then someone added !important to a component and messed it all up 🤷