Overview

Packages

  • csstidy
  • Text
    • Filter

Classes

  • csstidy
  • csstidy_optimise
  • csstidy_print
  • Overview
  • Package
  • Class
  • Tree

Class csstidy_optimise

CSS Optimising Class

This class optimises CSS data generated by csstidy.

Package: csstidy
Author: Florian Schmitz (floele at gmail dot com) 2005-2006
Located at Horde/Text/Filter/Csstidy/class.csstidy_optimise.php
Methods summary
public
# csstidy_optimise( array & $css )

Constructor

Constructor

Parameters

$css
contains the class csstidy
public
# postparse( )

Optimises $css after parsing

Optimises $css after parsing

public
# value( )

Optimises values

Optimises values

public
# shorthands( )

Optimises shorthands

Optimises shorthands

public
# subvalue( )

Optimises a sub-value

Optimises a sub-value

public string
# shorthand( string $value )

Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px

Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px

Parameters

$value

Returns

string
public string
# compress_important( string & $string )

Removes unnecessary whitespace in ! important

Removes unnecessary whitespace in ! important

Parameters

$string

Returns

string
public string
# cut_color( string $color )

Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.

Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.

Parameters

$color

Returns

string
public string
# compress_numbers( string $subvalue )

Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )

Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )

Parameters

$subvalue

Returns

string
public array
# merge_selectors( array & $array )

Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.

Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red} Very basic and has at least one bug. Hopefully there is a replacement soon.

Parameters

$array

Returns

array
public array
# dissolve_4value_shorthands( string $property, string $value )

Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...

Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...

Parameters

$property
$value

Returns

array

See

csstidy_optimise::merge_4value_shorthands()
public array
# explode_ws( string $sep, string $string )

Explodes a string as explode() does, however, not if $sep is escaped or within a string.

Explodes a string as explode() does, however, not if $sep is escaped or within a string.

Parameters

$sep
seperator
$string

Returns

array
public array
# merge_4value_shorthands( array $array )

Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()

Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()

Parameters

$array

Returns

array

See

csstidy_optimise::dissolve_4value_shorthands()
public array
# dissolve_short_bg( string $str_value )

Dissolve background property

Dissolve background property

Parameters

$str_value

Returns

array

See

csstidy_optimise::merge_bg()
public array
# merge_bg( array $input_css )

Merges all background properties

Merges all background properties

Parameters

$input_css

Returns

array

See

csstidy_optimise::dissolve_short_bg()
API documentation generated by ApiGen