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

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

csstool/css
===========

CSSTools :D

v1.0.0(7y ago)025MITPHP &gt;=5.3.0

Since Feb 24Compare

[ Source](https://github.com/igorfaria/CSSTool)[ Packagist](https://packagist.org/packages/csstool/css)[ RSS](/packages/csstool-css/feed)WikiDiscussions Synced 4d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

 [ ![CSSTool logo](https://camo.githubusercontent.com/725ff693b1ea94f313094931bfe68956c2e4e3fe48995e19c7d88c2c53443931/68747470733a2f2f69676f7266617269612e6769746875622e696f2f435353546f6f6c2f6173736574732f696d672f6c6f676f2e706e67) ](https://igorfaria.github.io/CSSTool/ "Another CSS tool in PHP")
 Another tool to parse CSS, minify and optimize CSS properties and values

 [https://igorfaria.github.io/CSSTool/](https://igorfaria.github.io/CSSTool/ "Another CSS tool in PHP")

CSS Tool
========

[](#css-tool)

#### Another CSS tool in CSS.

[](#another-css-tool-in-css)

This is a **CSS optimizer** that parse CSS code into a set of associatives arrays.
You can manipulate the CSS with PHP and execute the magic of optimization, outputing the result as a text or save into a file.

#### Optimizations

[](#optimizations)

- **Minify CSS**: Replace multiple spaces, break lines and last semicolons
- **Optimize Values**: Remove zeros when it is not needed (0.3s -&gt; .3s)
- **RGB to HEX**: Colors rgb to hex (*rgb(255,255,255)* -&gt; *\#fff*)
- **HLS to HEX**: Colors hls to hex (*hsl(236, 0%, 0%)* -&gt; *\#000*)
- **Optimize HEX**: Abbreviation for hex (*\#ffcc00* -&gt; *\#fc0*)
- **Improve Compatibility**: Add prefixes (*-webkit-*, *-moz-*, *-ms-* and *-o-*)
- **Optimize Syntax**: Shorthand properties

Installing
----------

[](#installing)

You can install via Composer using:

```
composer require csstool/css --prefer-dist

```

Or you can download the files directly from github.com and include the files that are in the /src/ folder by your own means.

### Usage

[](#usage)

You can use the CSS Tool to optimize one or multiple CSS files, outputing as a text or saving into a file.

```
