Css Class Collector (Purge CSS)
This module automatically scans your Drupal site and collects all CSS classes used in database-driven content. It generates a list of actually used CSS classes, which is useful for CSS optimization workflows that require accurate safelists to prevent the removal of dynamic or backend-generated classes.
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)
-
Copy
bootstrap.min.cssandbuild-css.jsfrom the module
into your custom theme directory root. -
Run the following command from the custom theme directory:
node build-css.js