2017 © Pedro Peláez
 

library 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.

image

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.

  • Friday, May 26, 2017
  • by PhrozenByte
  • Repository
  • 1 Watchers
  • 1 Stars
  • 268 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 37 % Grown

The README.md

CssMin

A (simple) css minifier with benefits, (*1)

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

This GitHub fork 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: https://github.com/PhrozenByte/cssmin, (*3)

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., (*4)

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., (*5)

Install

CssMin is available on Packagist.org and may be included in other projects via composer require phrozenbyte/cssmin. CssMin requires PHP 5.0+, (*6)

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

// 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();

The Versions

26/05 2017

dev-master

9999999-dev http://code.google.com/p/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.

  Sources   Download

MIT

The Requires

  • php >=5.0

 

css minify

26/05 2017

v3.0.2

3.0.2.0 http://code.google.com/p/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.

  Sources   Download

MIT

The Requires

  • php >=5.0

 

css minify

11/04 2017

v3.0.1+composer

3.0.1.0 http://code.google.com/p/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.

  Sources   Download

MIT

The Requires

  • php >=5.0

 

css minify