Hacker News new | ask | show | jobs
by alwillis 719 days ago
> Whatever Pagespeed or Lighthouse might say, we haven't found minification to be a big benefit when we turn it on.

Minify CSS Potential savings of 20 KiB Minify JavaScript Potential savings of 82 KiB

The benefit is less data going over the wire. I get it--100 KiB doesn't sound like much these days, especially given the page weight of almost 800 KiB. But it's still an extra 100 KiB that doesn't need to be transferred and it adds up over time.

If you minimized your code and did a few more optimizations, you're talking about a more significant amount of data you could be saving your viewers.

> Sometimes you need to be specific. You don't establish that that CSS is unnecessary to achieve the goal.

That selector and the many others like it is a sign of poor CSS architecture. If your design results in you having to be that specific, it means you're doing something wrong.

It's a classic case of fighting the cascade instead of having it work for you. If there was an architecture (like ITCSS or OOCSS for example) [1], you wouldn't need to write such a deeply nested selector in the first place and the dozens more just like it.

Creating reusable components in CSS would reduce the amount of code dramatically and make it much easier to maintain.

[1]: https://www.xfive.co/blog/itcss-scalable-maintainable-css-ar...

[2]: https://www.slideshare.net/slideshow/our-best-practices-are-...

[3]: https://csshell.dev/posts/overspecified-specificity/

1 comments

> The benefit is less data going over the wire. I get it--100 KiB doesn't sound like much these days, especially given the page weight of almost 800 KiB. But it's still an extra 100 KiB that doesn't need to be transferred and it adds up over time.

How much does that save, after the Brotli compression, and how much does it contribute to your supposed TTB? And why would it affect the page performance once loaded? And how does your alternate of CSS grids change that? If it is responsive, it is still going to have to define a bunch of CSS to explain what the layout is and how it changes.

> If your design results in you having to be that specific, it means you're doing something wrong.

Does it really? You keep making these assertions like 'you're using fake smallcaps' and then not backing them or explaining them, or giving any examples whatsoever of a site doing it right.