PHPackages                             phrozenbyte/cssmin - 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. phrozenbyte/cssmin

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

phrozenbyte/cssmin
==================

CssMin is a css parser and minfier. It minifies css by removing unneeded whitespace character, comments, empty blocks and empty declarations. In addition declaration values can get rewritten to shorter notation if available. The minification if configurable.

v3.0.4(9mo ago)21.3kMITPHPPHP &gt;=5.0

Since Apr 11Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/PhrozenByte/cssmin)[ Packagist](https://packagist.org/packages/phrozenbyte/cssmin)[ Docs](http://code.google.com/p/cssmin/)[ RSS](/packages/phrozenbyte-cssmin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

CssMin
======

[](#cssmin)

> A (simple) css minifier with benefits

This repository is a copy of CssMin by Joe Scylla, previously hosted on [Google Code](https://code.google.com/p/cssmin/), to support [Composer](https://getcomposer.org/). Please refer to the original homepage of CssMin on Google Code for more info:

This [GitHub fork](https://github.com/PhrozenByte/cssmin) aims to be the go-to address for Joe Scylla's CssMin. It was converted into a Composer library utilizing Composer's autoloader with the original non-concatenated PHP sources and aims to also include fixes from other CssMin forks. Even though this project isn't actively developed, we accept pull requests fixing existing problems, like compatibility issues with later PHP versions. Visit us on GitHub for more info:

What is CssMin?
---------------

[](#what-is-cssmin)

CssMin is a CSS parser and minfier. It minifies CSS by removing unneeded whitespace characters, comments, empty blocks and empty declarations. In addition declaration values can get rewritten to shorter notations if available. The minification is configurable.

CssMin has some benefits. It supports the rewrite of CSS Level 3 properties to their browser specific counterparts and is able to simulate CSS variables.

Install
-------

[](#install)

CssMin is available on [Packagist.org](https://packagist.org/packages/phrozenbyte/cssmin) and may be included in other projects via `composer require phrozenbyte/cssmin`. CssMin requires PHP 5.0+

Syntax
------

[](#syntax)

```
string CssMin::minify(string $source [, array $filters = array()][, array $plugins = array()]);

```

- `string $source` - The source css as string.
- `array $filters` - The filter configuration as array (optional).
- `array $plugins` - The plugin configuration as array (optional).

Example
-------

[](#example)

```
// Simple minification WITHOUT filter or plugin configuration
$result = CssMin::minify(file_get_contents("path/to/source.css"));

// Minification WITH filter or plugin configuration
$filters = array(/* ... */);
$plugins = array(/* ... */);

// Minify via CssMin adapter function
$result = CssMin::minify(file_get_contents("path/to/source.css"), $filters, $plugins);

// Minify via CssMinifier class
$minifier = new CssMinifier(file_get_contents("path/to/source.css"), $filters, $plugins);
$result = $minifier->getMinified();
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance57

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~1013 days

Total

4

Last Release

283d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b9996baadbfa50b15b704947db1aad17b75eae0350e36403e454bc845c83ab4?d=identicon)[PhrozenByte](/maintainers/PhrozenByte)

---

Top Contributors

[![PhrozenByte](https://avatars.githubusercontent.com/u/920356?v=4)](https://github.com/PhrozenByte "PhrozenByte (12 commits)")[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (2 commits)")[![nochso](https://avatars.githubusercontent.com/u/6887618?v=4)](https://github.com/nochso "nochso (2 commits)")[![neilime](https://avatars.githubusercontent.com/u/314088?v=4)](https://github.com/neilime "neilime (1 commits)")[![alexprey](https://avatars.githubusercontent.com/u/7888563?v=4)](https://github.com/alexprey "alexprey (1 commits)")[![nqxcode](https://avatars.githubusercontent.com/u/5667387?v=4)](https://github.com/nqxcode "nqxcode (1 commits)")[![gi-jones](https://avatars.githubusercontent.com/u/25205152?v=4)](https://github.com/gi-jones "gi-jones (1 commits)")[![pleinechope](https://avatars.githubusercontent.com/u/1331799?v=4)](https://github.com/pleinechope "pleinechope (1 commits)")[![redbraed](https://avatars.githubusercontent.com/u/46688431?v=4)](https://github.com/redbraed "redbraed (1 commits)")[![umulmrum](https://avatars.githubusercontent.com/u/6984809?v=4)](https://github.com/umulmrum "umulmrum (1 commits)")[![woecifaun](https://avatars.githubusercontent.com/u/5421942?v=4)](https://github.com/woecifaun "woecifaun (1 commits)")[![mlocati](https://avatars.githubusercontent.com/u/928116?v=4)](https://github.com/mlocati "mlocati (1 commits)")

---

Tags

csscssminminifyminify-csscssminify

### Embed Badge

![Health badge](/badges/phrozenbyte-cssmin/health.svg)

```
[![Health](https://phpackages.com/badges/phrozenbyte-cssmin/health.svg)](https://phpackages.com/packages/phrozenbyte-cssmin)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[natxet/cssmin

Minifying CSS

827.3M98](/packages/natxet-cssmin)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[jalle19/php-yui-compressor

A modern PHP wrapper for the YUI compressor

17972.2k3](/packages/jalle19-php-yui-compressor)[sensiolabs/minify-bundle

Assets Minifier (CSS, JS) for Symfony &amp; Minify integration in Asset Mapper

5694.9k1](/packages/sensiolabs-minify-bundle)[trentrichardson/cakephp-shrink

Compiles, combines, and minifies javascript, coffee, less, scss, and css

1619.3k](/packages/trentrichardson-cakephp-shrink)

PHPackages © 2026

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