Repeating CSS – Trying to Stay DRY

Some sobering numbers from a recent article on titled “70% Repetition in Style Sheets: Data on How We Fail at CSS Optimization” by Jens Oliver Meiert, shows the web as a whole has a CSS problem. For example Engadget has 28,909 CSS declarations with only 2,382 of them being unique. Other sites like Kickstarter and have similar stats.

What this shows me more than anything is large sites with large legacy code bases tend to have under-optimized bloated stylesheets. It’s no surprise to any of us that have been in the industry for a while especially if we have ever worked for a large organization. The fact is CSS optimization is hard. I agree with the author though in that we have to try. That is probably why I am a fan of the ongoing conversations about CSS through Javascript. While I might not agree all the time with those conversations, I do think having them is important to moving beyond the issues we see with large CSS codebases.

So, what do you think ?