PHPackages                             czproject/css-tools - 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. czproject/css-tools

ActiveLibrary

czproject/css-tools
===================

CSS tools for PHP

v1.0.0(11mo ago)127BSD-3-ClausePHPPHP 8.0 - 8.4CI passing

Since Apr 22Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/czproject/css-tools)[ Packagist](https://packagist.org/packages/czproject/css-tools)[ Fund](https://www.janpecha.cz/donate/)[ RSS](/packages/czproject-css-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

CzProject\\CssTools
===================

[](#czprojectcsstools)

[![Build Status](https://github.com/czproject/css-tools/workflows/Build/badge.svg)](https://github.com/czproject/css-tools/actions)[![Downloads this Month](https://camo.githubusercontent.com/cf5fbc9fb4b97f25efeb0102f5eb18d46c16a9f5ddb3f8666e05e32ec299e12c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f637a70726f6a6563742f6373732d746f6f6c732e737667)](https://packagist.org/packages/czproject/css-tools)[![Latest Stable Version](https://camo.githubusercontent.com/31e409e425e8e894519ceeaf9cde60b435b85d1cd1222871e8810629dcb3a0f6/68747470733a2f2f706f7365722e707567782e6f72672f637a70726f6a6563742f6373732d746f6f6c732f762f737461626c65)](https://github.com/czproject/css-tools/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/czproject/css-tools/blob/master/license.md)

CSS tools for PHP.

[![Donate](https://camo.githubusercontent.com/101b981194f1dafbf9c42e19c3034fe2d724e75be972cef0f4477074997834db/68747470733a2f2f6275796d65636f666665652e696e746d2e6f72672f696d672f646f6e6174652d62616e6e65722e76312e737667)](https://www.janpecha.cz/donate/)

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

[](#installation)

[Download a latest package](https://github.com/czproject/css-tools/releases) or use [Composer](http://getcomposer.org/):

```
composer require czproject/css-tools

```

CzProject\\CssTools requires PHP 8.0 or later.

Usage
-----

[](#usage)

### CSS compiler

[](#css-compiler)

Expands `@import` rules in file.

```
$compiler = new CzProject\CssTools\CssCompiler;
$compiler->compileFile(__DIR__ . '/styles.css'); // overwrite styles.css with compiled version
$compiledStyles = $compiler->processFile(__DIR__ . '/styles2.css');
$compiledStyles = $compiler->processContent(
	'@import "mystyles.css";',
	$stylesheetsRootDirectory
);
```

### CSS generator

[](#css-generator)

```
$file = new CzProject\CssTools\CssFile;
$file->addRule('.button', [
	'color' => CssTools\Color::hex('#F8A'),
	'font-size' => CssTools\Number::px2rem(48),
	'background-color' => NULL,
]);

echo $file->render();
```

### CSS minifier

[](#css-minifier)

```
$minifier = new CzProject\CssTools\CssMinifier;
$result = $minifier->minify("body {
	color: #333;
	background: #fff;
}");
var_dump($result); // Output: body{color:#333;background:#fff}
```

---

License: [New BSD License](license.md)
Author: Jan Pecha,

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance52

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

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

Total

2

Last Release

349d ago

Major Versions

v0.9.0 → v1.0.02025-06-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c980b1511b4a0350442dc23d89c99d4d9a2411b7e765d52c133ccacf616968b?d=identicon)[janpecha](/maintainers/janpecha)

---

Top Contributors

[![janpecha](https://avatars.githubusercontent.com/u/637719?v=4)](https://github.com/janpecha "janpecha (34 commits)")

### Embed Badge

![Health badge](/badges/czproject-css-tools/health.svg)

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

PHPackages © 2026

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