Drupal is a registered trademark of Dries Buytaert

CSS Class Collector (useful for CSS purging)

The CSS Class Collector module automatically scans your Drupal site
and collects all CSS classes used in database-driven content.

It generates a reliable, real-world list of CSS classes actually used across the site.
This is especially useful for projects using PurgeCSS,
Tailwind CSS, Bootstrap, or any CSS optimization
workflow that depends on accurate safelists to prevent removal of dynamic or
backend-generated classes.

By using this module, you can safely purge unused CSS without breaking layouts
or functionality.

Steps to purge CSS(if using bootstrap_barrio as base theme)

  1. Copy bootstrap.min.css and build-css.js from the module
    into your custom theme directory root.
  2. Run the following command from the custom theme directory:
    node build-css.js

Activity

Total releases
5
First release
Nov 2025
Latest release
2 months ago
Release cadence
8 days
Stability
80% stable

Release Timeline

Releases

Version Type Release date
1.0.4 Stable Dec 29, 2025
1.0.3 Stable Dec 29, 2025
1.0.2 Stable Dec 29, 2025
1.0.0 Stable Nov 26, 2025
1.0.x-dev Dev Nov 26, 2025