PHPackages                             jelle-s/cssoptimizer - 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. jelle-s/cssoptimizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jelle-s/cssoptimizer
====================

Optimizes &amp; minifies css files or strings.

1.0.0(9y ago)194GPL-3.0+PHP

Since Dec 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Jelle-S/CssOptimizer)[ Packagist](https://packagist.org/packages/jelle-s/cssoptimizer)[ RSS](/packages/jelle-s-cssoptimizer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

CssOptimizer
============

[](#cssoptimizer)

Optimizes CSS (combines duplicate selectors, extracts duplicate css properties and values, minifies the css).

Render minified CSS:

```
$optimizer = new Jelle_S\CssOptimizer\CssOptimizer($css);
file_put_contents('style.min.css', $optimizer->renderMinifiedCSS());
```

Render SCSS from your css:

```
$optimizer = new Jelle_S\CssOptimizer\CssOptimizer($css);
file_put_contents('style.scss', $optimizer->renderSCSS());
```

This code is open source (GPL-3.0), however, if you like this class and you would like to sponsor the developer (me), feel free to [![paypal](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AG7DAWA24HSRN).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3427d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd0af1f056fd3baa2df55c0c745ade4d0f8af99505f717bf0ad48d7b615a2153?d=identicon)[Jelle-S](/maintainers/Jelle-S)

---

Top Contributors

[![Jelle-S](https://avatars.githubusercontent.com/u/1828542?v=4)](https://github.com/Jelle-S "Jelle-S (11 commits)")

### Embed Badge

![Health badge](/badges/jelle-s-cssoptimizer/health.svg)

```
[![Health](https://phpackages.com/badges/jelle-s-cssoptimizer/health.svg)](https://phpackages.com/packages/jelle-s-cssoptimizer)
```

###  Alternatives

[lullabot/amp

A set of useful classes and utilities to convert html to AMP html (See https://www.ampproject.org/)

3802.9M10](/packages/lullabot-amp)[padaliyajay/php-autoprefixer

CSS Autoprefixer written in pure PHP.

468.3M8](/packages/padaliyajay-php-autoprefixer)[northys/css-inliner

PHP Library that converts css file into html inline styles.

4516.2k](/packages/northys-css-inliner)[drupaljedi/css-tree-shaking

Helps you to eliminate the portions of CSS you aren't using. Usually should be used to generate AMP pages, where is the fixed limit for maximum styles size.

1122.3k](/packages/drupaljedi-css-tree-shaking)

PHPackages © 2026

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