PHPackages                             toastnz/deferred-css - 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. toastnz/deferred-css

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

toastnz/deferred-css
====================

A Silverstripe CMS module for deferred CSS loading.

6.0.1(1mo ago)0130BSD-3-ClausePHP

Since Jun 11Pushed 1mo agoCompare

[ Source](https://github.com/toastnz/deferred-css)[ Packagist](https://packagist.org/packages/toastnz/deferred-css)[ RSS](/packages/toastnz-deferred-css/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (12)Versions (8)Used By (0)

Deferred CSS for Silverstripe
=============================

[](#deferred-css-for-silverstripe)

This module customises Silverstripe's requirements backend to defer CSS loading using the `preload` pattern.

It overrides `includeInHTML()` and rewrites stylesheet links to:

```

```

This helps reduce initial render-blocking caused by CSS files while still applying styles once each file has loaded.

What this module changes
------------------------

[](#what-this-module-changes)

- Replaces the default `SilverStripe\View\Requirements_Backend` via Injector.
- Overrides `includeInHTML()` in `Toast\Injectors\ToastEnhancedBackend`.
- Keeps JavaScript and custom head tags injection behavior aligned with the parent backend flow.
- Converts CSS requirements to `rel="preload"` links with an `onload` switch to `rel="stylesheet"`.

Configured in `_config/config.yml`:

```
SilverStripe\Core\Injector\Injector:
  SilverStripe\View\Requirements_Backend:
    class: Toast\Injectors\ToastEnhancedBackend
```

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

[](#installation)

```
composer require toastnz/deferred-css
```

Then flush configuration:

```
vendor/bin/sake dev/build flush=all
```

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

[](#how-it-works)

In `ToastEnhancedBackend::includeInHTML()`:

1. Checks if `` exists and there are requirements to inject.
2. Runs `processCombinedFiles()` to preserve combined assets behavior.
3. Outputs JavaScript includes and inline custom scripts.
4. Rewrites CSS includes as preload links with `as="style"` and `onload` rel swap.
5. Injects CSS/head tags into `` and scripts according to Silverstripe settings.

Notes
-----

[](#notes)

- This module targets Silverstripe Framework 6.
- `onload`-based deferred CSS is widely used, but always test critical rendering paths in your project.
- Validate frontend behavior in older browsers used by your audience.

License
-------

[](#license)

BSD-3-Clause. See `LICENSE`.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

45d ago

Major Versions

4.0.1 → 5.0.02026-06-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cc41858b7e0e95f7c9ff396fc2d454339424c425d8f78aeb526434da6f61543?d=identicon)[priscilla-toastnz](/maintainers/priscilla-toastnz)

---

Top Contributors

[![priscillay-toast](https://avatars.githubusercontent.com/u/92568971?v=4)](https://github.com/priscillay-toast "priscillay-toast (2 commits)")

---

Tags

silverstripecms

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/toastnz-deferred-css/health.svg)

```
[![Health](https://phpackages.com/badges/toastnz-deferred-css/health.svg)](https://phpackages.com/packages/toastnz-deferred-css)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5253.6M1.4k](/packages/silverstripe-cms)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[sunnysideup/typography

Add a typography test page to your silverstripe website / application.

124.4k4](/packages/sunnysideup-typography)

PHPackages © 2026

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