PHPackages                             nerds-and-company/css-to-inline-styles-twig-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. nerds-and-company/css-to-inline-styles-twig-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

nerds-and-company/css-to-inline-styles-twig-extension
=====================================================

A Twig extension to insert css as inline styles with a tag

2.0.0(6y ago)339.8k↓39.7%21MITPHPPHP &gt;=7.2.5CI failing

Since Mar 2Pushed 6y ago5 watchersCompare

[ Source](https://github.com/nerds-and-company/css-to-inline-styles-twig-extension)[ Packagist](https://packagist.org/packages/nerds-and-company/css-to-inline-styles-twig-extension)[ Docs](https://github.com/nerds-and-company/css-to-inline-styles-twig-extension)[ RSS](/packages/nerds-and-company-css-to-inline-styles-twig-extension/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (6)Used By (1)

Inline Css extension to convert css to inline styles
====================================================

[](#inline-css-extension-to-convert-css-to-inline-styles)

[![Build Status](https://camo.githubusercontent.com/ca5adcb546af7e13b9e17e88d61ae0ab74afb48c4f8e6cf6ccbc0130397abe2a/68747470733a2f2f7472617669732d63692e6f72672f6e657264732d616e642d636f6d70616e792f6373732d746f2d696e6c696e652d7374796c65732d747769672d657874656e73696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nerds-and-company/css-to-inline-styles-twig-extension)[![Latest Stable Version](https://camo.githubusercontent.com/bc81aec2aabfce9f6add342f84deb8420738fe7ce916912532a4fe3ddc498d2e/68747470733a2f2f706f7365722e707567782e6f72672f6e657264732d616e642d636f6d70616e792f6373732d746f2d696e6c696e652d7374796c65732d747769672d657874656e73696f6e2f762f737461626c65)](https://packagist.org/packages/nerds-and-company/css-to-inline-styles-twig-extension) [![Total Downloads](https://camo.githubusercontent.com/ab38d084bb734fba53576187529420c4e5bb203262ad8efecb90f2c32e983b1e/68747470733a2f2f706f7365722e707567782e6f72672f6e657264732d616e642d636f6d70616e792f6373732d746f2d696e6c696e652d7374796c65732d747769672d657874656e73696f6e2f646f776e6c6f616473)](https://packagist.org/packages/nerds-and-company/css-to-inline-styles-twig-extension) [![Latest Unstable Version](https://camo.githubusercontent.com/e347456c871d73ffcfc3a7af92a4b3fceaf9f9c4d6f8bacba987c9938f92c63a/68747470733a2f2f706f7365722e707567782e6f72672f6e657264732d616e642d636f6d70616e792f6373732d746f2d696e6c696e652d7374796c65732d747769672d657874656e73696f6e2f762f756e737461626c65)](https://packagist.org/packages/nerds-and-company/css-to-inline-styles-twig-extension) [![License](https://camo.githubusercontent.com/1122b8dcb14feee668c009b4d3cf68a31540d08609685166d91af68eea8e5358/68747470733a2f2f706f7365722e707567782e6f72672f6e657264732d616e642d636f6d70616e792f6373732d746f2d696e6c696e652d7374796c65732d747769672d657874656e73696f6e2f6c6963656e7365)](https://packagist.org/packages/nerds-and-company/css-to-inline-styles-twig-extension)

Based on work by Roberto Trunfio on

Makes use of  by Tijs Verkoyen

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

[](#installation)

This twig extension is installed through Composer. Run the following command from the root of your project:

`composer require nerds-and-company/css-to-inline-styles-twig-extension`

This will add nerds-and-company/css-to-inline-styles-twig-extension as a requirement to your project's composer.json file and install the source-code into the vendor/nerds-and-company/css-to-inline-styles-twig-extension directory

Add the extension to the `Twig_Environment`:

```
use NerdsAndCompany\CssToInlineStyles\Twig\InlineCssExtension;
use Twig\Environment;

$twig = new Environment(...);

$twig->addExtension(new InlineCssExtension());
```

Usage
-----

[](#usage)

```
{% inlinecss '/absolute/path/file.css' %}
   Html to be converted
{% endinlinecss %}

```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 76.5% 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 ~299 days

Total

5

Last Release

2214d ago

Major Versions

1.1.2 → 2.0.02020-06-11

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

2.0.0PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/473941cfd5dd7f9070a5ee2e0c7fe71ef6f9aed74e40cee91cebf77a2392bb27?d=identicon)[nerds-and-company](/maintainers/nerds-and-company)

---

Top Contributors

[![bvangennep](https://avatars.githubusercontent.com/u/12080429?v=4)](https://github.com/bvangennep "bvangennep (13 commits)")[![sjoulbak](https://avatars.githubusercontent.com/u/1494052?v=4)](https://github.com/sjoulbak "sjoulbak (4 commits)")

---

Tags

twigcssinline

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nerds-and-company-css-to-inline-styles-twig-extension/health.svg)

```
[![Health](https://phpackages.com/badges/nerds-and-company-css-to-inline-styles-twig-extension/health.svg)](https://phpackages.com/packages/nerds-and-company-css-to-inline-styles-twig-extension)
```

###  Alternatives

[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22920.3M88](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

22018.6M356](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1647.0M127](/packages/symfony-ux-live-component)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

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