PHPackages                             unclecheese/silverstripe-blubber - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. unclecheese/silverstripe-blubber

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

unclecheese/silverstripe-blubber
================================

Identifies unused CSS in your SilverStripe project

5302[4 PRs](https://github.com/unclecheese/silverstripe-blubber/pulls)PHP

Since Jul 17Pushed 10y ago2 watchersCompare

[ Source](https://github.com/unclecheese/silverstripe-blubber)[ Packagist](https://packagist.org/packages/unclecheese/silverstripe-blubber)[ RSS](/packages/unclecheese-silverstripe-blubber/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

silverstripe-blubber
====================

[](#silverstripe-blubber)

This module provides a task that scans your theme directory for css files, and checks all of their selectors against real HTML samples taken from your project. Those that match are placed in a "keep" file, and those that have no matches are placed in a "discard" (blubber) file.

Installation
------------

[](#installation)

`composer require unclecheese/silverstripe-blubber:dev-master`

Screenshot
----------

[](#screenshot)

[![](https://raw.githubusercontent.com/unclecheese/silverstripe-blubber/master/images/Screenshot%202015-07-17%2013.10.16.png)](https://raw.githubusercontent.com/unclecheese/silverstripe-blubber/master/images/Screenshot%202015-07-17%2013.10.16.png)

How it works
------------

[](#how-it-works)

There are five stages to the task:

- Scan for theme CSS, and prompt the user for which files should be included in the assessment
- Gather all the templates in the manifest, and store their HTML
- Emulate HTTP requests against a sample of actual pages and DataObjects stored in the database, and store the rendered HTML
- Parse the CSS file, and check each declaration block against all the HTML samples, both static (unrendered) and dynamic (rendered via HTTP response)
- Cut two new files for each included CSS file: `myfile.lean.css` and `myfile.blubber.css`, which contain the "good" rules and the "bad" rules, respectively.

Rationale
---------

[](#rationale)

There are a few tools that do this already. Most of them work by spidering the site and building up a state of unused selectors. There are two major limitations with this approach:

- They don't account for various UI state changes that happen after page load (e.g. form validation)
- They do not future-proof against content that may not currently exist, but could likely be used further down the track, such as a page type, with a custom template, that simply hasn't been saved in the CMS yet.

Because almost all HTML is rendered through `.ss` files in SilverStripe, scanning all the templates provides nearly all possible UI state the project may have now or in the future.

However, there limitations to simply scanning `.ss` templates as static HTML. They do not account for content that may be relevant to CSS that is rendered dynamically, for instance: `` or ``. This content can only be obtained by generating a true rendering of the HTML.

Given these two sets of complimentary advantages and shortcomings, this module uses both approaches in serial, to produce as few false-positives as possible.

Limitations
-----------

[](#limitations)

Still, there are two main areas that will generate false positives:

- CSS selectors that depend on JavaScript DOM mutations, e.g. `"`
- Logged-in state, e.g. `$CommentForm`.

The tool should not be used without discretion, but rather, provide the lion's share of the CSS that needs to be removed.

Configuration
-------------

[](#configuration)

There are a few configuration options you can throw at the task that get passed off to the `Sampler` object. These are useful for adjusting the parameters around what database content gets spidered.

```
CSSBlubberTask:
  extra_dataobjects: []
  omit:
    - RedirectorPage
  limits: {}
  default_limit: 3
  theme_css_dir: 'base/production/css/'
```

- `extra_dataobjects`: Allows you to specify a list of DataObjects whose URLs you want spidered, e.g. `Product`, `ForumPost`. **NB**: these objects must have a `Link()` method.
- `omit`: Classes to omit from the spider
- `limits`: A map of class names to the number of records that should be sampled., e.g. `{ Product: 10 }` will ensure that no more than 10 Product objects get their HTML scanned. If there are 1,000 products in the database, there's no need in scanning each one. They all use the same template and CSS, with little variation.
- `default_limit`: If no limit is specified for the class, this is the number that's applied.
- `theme_css_dir`: Specify a path where CSS resides for a theme

Todo
----

[](#todo)

- Allow exclusions of module templates (e.g. framework)
- Break up this module into separate packages (Outputter, Sampler)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/654636?v=4)[Aaron Carlino](/maintainers/unclecheese)[@unclecheese](https://github.com/unclecheese)

---

Top Contributors

[![stevie-mayhew](https://avatars.githubusercontent.com/u/1953220?v=4)](https://github.com/stevie-mayhew "stevie-mayhew (3 commits)")

### Embed Badge

![Health badge](/badges/unclecheese-silverstripe-blubber/health.svg)

```
[![Health](https://phpackages.com/badges/unclecheese-silverstripe-blubber/health.svg)](https://phpackages.com/packages/unclecheese-silverstripe-blubber)
```

###  Alternatives

[alkoumi/laravel-hijri-date

Laravel package to Convert laravel date to our Amazing 💝 Hjri date {ummul qura and vice versa} . to look like \[ الخميس ، ٢٢ ربيع الآخر ، ١٤٤١ - ٠٧:٤٩ مساءً\]

109166.2k2](/packages/alkoumi-laravel-hijri-date)[uspdev/replicado

Classes PHP que consome dados do Replicado USP

136.2k7](/packages/uspdev-replicado)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
