PHPackages                             twig/cssinliner-extension - 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. [Templating &amp; Views](/categories/templating)
4. /
5. twig/cssinliner-extension

Abandoned → [twig/cssinliner-extra](/?search=twig%2Fcssinliner-extra)ArchivedLibrary[Templating &amp; Views](/categories/templating)

twig/cssinliner-extension
=========================

A Twig extension to allow inlining CSS

v2.0.0(7y ago)31153.9k↓33.3%2[1 issues](https://github.com/twigphp/cssinliner-extension/issues)2MITPHPPHP ^7.0

Since Feb 23Pushed 6y ago3 watchersCompare

[ Source](https://github.com/twigphp/cssinliner-extension)[ Packagist](https://packagist.org/packages/twig/cssinliner-extension)[ Docs](https://twig.symfony.com)[ RSS](/packages/twig-cssinliner-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (2)

Twig CSS Inliner Extension
==========================

[](#twig-css-inliner-extension)

**WARNINIG**: This package is deprecate; migrate to `twig/cssinliner-extra` instead.

This package provides a CSS inliner filter (`inline_css`) for Twig and a Symfony bundle.

If you are not using Symfony, register the extension on Twig's `Environment`manually:

```
use Twig\CssInliner\CssInlinerExtension;
use Twig\Environment;

$twig = new Environment(...);
$twig->addExtension(new CssInlinerExtension());
```

Use the `inline_css` filter from a Twig template:

```
{% filter inline_css %}

                p { color: red; }

            Hello CSS!

{% endfilter %}
```

You can also add some stylesheets by passing them as arguments to the filter:

```
{% filter inline_css(source("some_styles.css"), source("another.css")) %}

            Hello CSS!

{% endfilter %}
```

Styles loaded via the filter override the styles defined in the `` tag of the HTML document.

You can also use the filter on an included file:

```
{{ include('some_template.html.twig')|inline_css }}

{{ include('some_template.html.twig')|inline_css(source("some_styles.css")) }}
```

Note that the CSS inliner works on an entire HTML document, not a fragment.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

2

Last Release

2640d ago

Major Versions

v1.0.0 → v2.0.02019-02-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47313?v=4)[Fabien Potencier](/maintainers/fabpot)[@fabpot](https://github.com/fabpot)

---

Top Contributors

[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (5 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")

---

Tags

cssinlinerphptwigtwig-extensiontwigcssinlining

### Embed Badge

![Health badge](/badges/twig-cssinliner-extension/health.svg)

```
[![Health](https://phpackages.com/badges/twig-cssinliner-extension/health.svg)](https://phpackages.com/packages/twig-cssinliner-extension)
```

###  Alternatives

[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.5M55](/packages/twig-cssinliner-extra)[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36763.2M221](/packages/twig-intl-extra)[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

22046.0M133](/packages/twig-string-extra)[symfony/ux-twig-component

Twig components for Symfony

21914.8M162](/packages/symfony-ux-twig-component)

PHPackages © 2026

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