PHPackages                             thewind1984/css-optimizator - 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. thewind1984/css-optimizator

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

thewind1984/css-optimizator
===========================

Interface accepts css files and folders / single templates files, then combines provided css files into one, compares it with provided templates, removes unused selectors and minifies final file

1.2.1(6y ago)048[7 issues](https://github.com/thewind1984/css-optimizator/issues)MITPHPPHP ^7.2

Since May 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/thewind1984/css-optimizator)[ Packagist](https://packagist.org/packages/thewind1984/css-optimizator)[ Docs](http://dignatiev.ru/portfolio/55/css-optimizator)[ RSS](/packages/thewind1984-css-optimizator/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

CSS optimizator
===============

[](#css-optimizator)

Interface accepts css files and folders / single templates files, then combines provided css files into one, compares it with provided templates, removes unused selectors and minifies final file.
It supports twig templates also, because `{% %}`, `{{ }}` and `{# #}` will be deleted before check.

[![Latest Stable Version](https://camo.githubusercontent.com/07d04b847ba61c08efeb07c42632478fc5058b57ea0ba71fa141675d0a435bee/68747470733a2f2f706f7365722e707567782e6f72672f74686577696e64313938342f6373732d6f7074696d697a61746f722f762f737461626c652e737667)](https://packagist.org/packages/thewind1984/css-optimizator)[![GitHub license](https://camo.githubusercontent.com/a0962a440cb6b972d462f1204d729df4fc1a592c2809f38d2b9e29a59a1c33f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74686577696e64313938342f6373732d6f7074696d697a61746f722e737667)](https://github.com/thewind1984/css-optimizator/blob/master/LICENSE)

Features
--------

[](#features)

- Chains of CSS selectors like **&gt;**, **~**
- Pseudo-classes (with optional sub-selectors)
- Multiple selectors separated with **, (comma)**

TODO
----

[](#todo)

- Parsing of chains of CSS selectors with **+** separator
    - `.class + .subclass`
- Parsing of selectors, which are implemented with quatro brackets
    - `audio[controls]`
    - `[id*="xxx"]`, `[class^="yyy"]`, `[attr$="zzz"]`
- Implementation convertion to xPath for pseudo-classes
    - `nth-child`
- Combining of duplicated selectors
    - `body {margin; 0;} body {color: #000;}` =&gt; `body {margin: 0; color: #000;}`
- Unification / optimization the rules inside selector
    - `margin: 0; margin-bottom: 10px;` =&gt; `margin: 0 0 10px;`

Installation through Composer
-----------------------------

[](#installation-through-composer)

> composer require thewind1984/css-optimizator

Usage
-----

[](#usage)

> require\_once './vendor/autoload.php';
> $cssOptimizator = new \\CssOptimizator\\CssOptimize\\CssOptimize();
> $cssOptimizator-&gt;addCssFile('path/to/assets/file.css');
> $cssOptimizator-&gt;addSourceFile('path/to/templates/page.html');
> $cssOptimizator-&gt;optimize()-&gt;minify()-&gt;saveContent('path/to/assets/file.min.css');

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~89 days

Total

6

Last Release

2200d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/929290b96a3807bc71ec9bc33720b4f62042b52e97b51ad1b434eda21a7158dc?d=identicon)[thewind1984](/maintainers/thewind1984)

---

Top Contributors

[![thewind1984](https://avatars.githubusercontent.com/u/10926561?v=4)](https://github.com/thewind1984 "thewind1984 (3 commits)")

---

Tags

twigcssminifycleanoptimizationminificationoptimize

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thewind1984-css-optimizator/health.svg)

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

###  Alternatives

[twig/cssinliner-extra

A Twig extension to allow inlining CSS

23018.5M55](/packages/twig-cssinliner-extra)[nochso/html-compress-twig

Twig extension for compressing HTML and inline CSS/Javascript

84468.6k8](/packages/nochso-html-compress-twig)[fitztrev/laravel-html-minify

Minifies the HTML output of Laravel 4 applications

414211.4k](/packages/fitztrev-laravel-html-minify)[rmrevin/yii2-minify-view

Yii2 View component with auto minification css &amp; js in runtime

194302.3k7](/packages/rmrevin-yii2-minify-view)[voku/html-compress-twig

Twig extension for compressing HTML

252.3M](/packages/voku-html-compress-twig)[odan/twig-assets

Caching and compression for Twig assets (JavaScript and CSS).

2223.0k4](/packages/odan-twig-assets)

PHPackages © 2026

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