Looking for suggestions/experiences using 'css cleanup' tools ala PurgeCSS...

This page summarizes the projects mentioned and recommended in the original post on /r/css

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • purgecss

    Remove unused CSS

    It should also be possible to use it for Sass files with for example Webpack. Look at the webpack solution proposed here, for example: https://github.com/FullHuman/purgecss/issues/163

  • hgrid-css

    🌟 A lightweight and practical CSS utility kit. Zero config. Flat learning curve.

    As I use my own css framework (hgrid-css) I always have a whole bunch of classes in my css output that aren't used. I just purge all these and it works. I never touch the framework partials as part of the project itself, so I (almost) never have mess in my working scss files that need to be cleaned out, unlike what your issue is. As I don't have a problem with all the unused sass styles, I don't care to try to maintain the sass at all. I mostly work with purged CSS both on localhost and in prod, so I never see all the unused mess. If you take a look at the hgrid.io repository you'll see in package.json how I run purgecss on every start command and build command. So when sass is watching file changes I now and then have to stop and restart to reevaluate with purgecss. This way I always debug css based on what's really in my browser, and not what is in my source code.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts