Skip to content

Latest commit

 

History

History
111 lines (103 loc) · 2.75 KB

File metadata and controls

111 lines (103 loc) · 2.75 KB

minify()

Minifies the CSS document with the inputted or default options.

$doc = new \hexydec\css\cssdoc();
if ($doc->load($html)) {
	$doc->minify($options);
}

Arguments

$options

An optional array contains a list of configuration parameters to configure the minifier output, the options are as follows and are recursively merged with the default config:

Parameter Type Description Default
semicolons Boolean Removes the semi-colon from the last property of each rule true
zerounits Boolean Removes the unit specification from values that are 0 true
leadingzeros Boolean Removes the leading zero from decimal value < 0 true
trailingzeros Boolean Removes any trailing 0's from fractional values (74.0 => 74) true
decimalplaces Integer Maximum number of decimal places for a value 4
quotes Boolean Removes quotes where they are not required true
convertquotes Boolean Converts quotes to double quotes true
colors Boolean Shortens hexidecimal colours to 3 chars where possible, and replaces colour values with their name where shorter true
time Boolean Shortens time values where possible e.g. 500ms becomes .5s true
fontweight Boolean Shortens normal and bold to 400 and 700 in the font-weight property true
none Boolean Replaces none with 0 where possible true
lowerproperties Boolean Lowercases property names true
lowervalues Boolean Lowercases property values where possible true

Returns

void