Samstag, 29. März 2014

Spring-cleaning Unused CSS




CSS-Tricks





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








Keine Kommentare:

Kommentar veröffentlichen