\csstidy_optimise
CSS Optimising Class
This class optimises CSS data generated by csstidy.
- Author: Florian Schmitz (floele at gmail dot com) 2005-2006
Synopsis
class csstidy_optimise
{
- // methods
- public void csstidy_optimise()
- public void postparse()
- public void value()
- public void shorthands()
- public void subvalue()
- public string shorthand()
- public string compress_important()
- public string cut_color()
- public string compress_numbers()
- public array merge_selectors()
- public array dissolve_4value_shorthands()
- public array explode_ws()
- public array merge_4value_shorthands()
- public array dissolve_short_bg()
- public array merge_bg()
Tasks
Line | Task |
---|---|
649+ | full CSS 3 compliance |
735+ | full CSS 3 compliance |
Methods
public
- compress_important() — Removes unnecessary whitespace in ! important
- compress_numbers() — Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
- csstidy_optimise() — Constructor
- cut_color() — Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
- dissolve_4value_shorthands() — Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
- dissolve_short_bg() — Dissolve background property
- explode_ws() — Explodes a string as explode() does, however, not if $sep is escaped or within a string.
- merge_4value_shorthands() — Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
- merge_bg() — Merges all background properties
- merge_selectors() — 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.
- postparse() — Optimises $css after parsing
- shorthand() — Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
- shorthands() — Optimises shorthands
- subvalue() — Optimises a sub-value
- value() — Optimises values