styleCow

Css preprocesor written in php

Latest changes:

What is styleCow?

It is a php library that allows parsing and manipulating css files. The main class is styleCow that loads and parses the css file(s) creating an internal array with all the selectors, properties and values. Then you can transform the array using one or moreavailable plugins and finally return the css code.

Example

include('stylecow/stylecow.php');

//Fist we instance the class (note that we are using namespaces)
$styleCow = new stylecow\Stylecow();

//Load the file
$styleCow->load('my-styles.css');

//Transform the css file using one or more plugins (for example vendor_prefixes or variables)
$styleCow->transform(array(
	'vendor_prefixes',
	'variables'
));

//Get the result css code
$css = $styleCow->toString();

//Print the css code and die
$styleCow->show();

Features

Fork me on Github