Spring-cleaning Unused CSS

Addy Osmani intros a Grunt task for removing unused CSS from your stylesheet before serving it.

While this is certainly a worthy goal, I look at the quotes from people who reduced their stylesheets by 3/4 or more and I’m like holy crap what kinda shop are you running over there?! I know “test, don’t guess”, but I’d guess that pretty close to 0% of the styles I write are unused. I’m sure HTML changes over time make a orphaned rule here and there, but I’d guess that is largely insignificant.

If you’re going to do this, make sure you run it against lots (if not all) of your pages so you aren’t removing selectors that are in use, just not on every page. I know I write minor styles all the time that make their way into the global stylesheet since that is cached and used anyway.

Direct Link to ArticlePermalink


Spring-cleaning Unused CSS is a post from CSS-Tricks

from CSS-Tricks http://ift.tt/1for8xJ

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s