This is a real worry these days. I’ve heard it from lots of lots of developers. The years tick by on their projects, and all they ever seem to do is add to their CSS, never remove. It’s not just a feeling, I’ve talked with companies before that track hard data on this. Over five years of tracking the size of their stylesheet, and all it’s ever done is tick upwards in size.
This could be considered problematic for several reasons:
Files getting bigger is worse for performance
The developers are afraid of the CSS
But being afraid of your own styles is a bigger problem.
“Afraid” isn’t usually how this problem is talked about, but I think that’s what it amounts to. It’s often talked about in terms of how the global nature of CSS is problematic or that the middle “S” in “CSS” is the only one worth saving.
Part of this story could certainly be about deleting CSS that is determined to be “unused” in a project. I know there is incredible demand for this kind of tooling. I feel like there are some developers damn near frothing at the mouth to blast their CSS through some kind of fancy tool to strip away anything unneeded.
This worries me just a little bit. It feels like saying: “Yes, I am afraid of our stylesheets. I don’t want to understand them, I just want something to fix them for me.”
Here’s how one company I heard from was doing
Via: Oh No! Our Stylesheet Only Grows and Grows and Grows! (The Append-Only Stylesheet Problem)