Static Media Manager v0.3 documentation
The CSS compression used was ported over from YUI Compressor. It is available separately at github.
Each part of the compression is separated and could technically be turned off, although there is no configuration mechanism for that currently. Some of the regular expressions could fail if other parts are turned off as they may assume that a previous filter has already ran. For example, some of the filters may assume the normalize_whitespace filter has ran and not look for multiple spacing options.
Removes multi-line (/* ... */) and single line (// ...) comments.
Convert all whitespace, including line endings, to a single space. This makes manipulation a bit easier.
Make a pseudo class for the Box Model Hack that is sometimes used to make Internet Explorer work right. The hack itself could be destroyed by some of the filters, so this filter replaces it with ___PSEUDOCLASSBMH___ so it can be restore later.
Undo what was done with the convert_boxmodelhack.
Remove the spaces before the things that should not have spaces before them. But, be careful not to turn p :link {...} into p:link{...}. Swap out any pseudo-class colons with the token, and then swap back.
Add a semicolon before any } if it is missing.
This filter does several things. First it strips out any measurement unit after a 0, so 0px becomes 0. Then it converts measurements with multiple dimensions of zero to just one zero, so 0 0 0 0 becomes 0. Finally it strips the leading zero from decimal measurements between zero and one, so 0.6 becomes .6.
There are two parts to this filter. The first part converts colors specified using rgb(0, 0, 0) notation to hex notation (#000000).
Next the hex colors are reduced from six characters to three characters if each pair of characters is the same (#aabbcc becomes #abc).
Remove any empty rules, such as p { }.
Convert multiple semicolons in a row with just one.