How to remove unused CSS from your website

Click for: original source

An article by Dan Englishby describing how to go about clearing CSS files. A cascading style sheet can gradually build up into a bulky file over time. This means two things, your CSS file is messy, and it’s unnecessarily bigger.

A bigger CSS file indicates more significant download times, and we don’t want that if it’s not necessary!

The article contains:

  • Prerequisites
  • Understanding how PurifyCSS works
  • Installing PurifyCSS
  • Prepping our files
  • Creating the JS Purifier Script
  • Purifying

In this article the author used PurifyCSS to shed 13kb from example CSS file, which was a 70% reduction. Nice work!

[Read More]

Tags how-to css programming performance