CSSqueeze …
It's a single PHP class licensed under Apache 2 and GPLv2.
- PHP 5.3
- PHP 5.4
- PHP 5.5
- PHP 5.6
- Remove white space and extra characters
- whitespace
- Last semicolon in a statement
- Measurement units for the values (eg margin: 0px -> margin: 0)
- Comments (preserving
/*! important comments */
) - Empty statements (eg p {})
- Use shorthand properties
- margin
- padding
- border
- outline
- list-style
- background (eg instead of background-color)
- Compress colors
- Use short notations of hexadecimal colors (Ex: color: # ff6600 becomes color: # f60;). Use colors supported in CSS 2 whose name is shorter than the hexadecimal.
- Sorting CSS properties
- Merge properties
- merge rules if required
- @import CSS only if file exists
- @media queries CSS
ranking is by after compression and gzipped, after compression
file compressed : 002/002.css from csszengarden.com
origin | after compression | saved | compression ratio | after compression and gzipped | compression and gzip ratio | |
CSSqueeze | 5547 | 2862 | 2685 | 48,40% | 919 | 83,43% |
csscompressor | 5547 | 2863 | 2684 | 48,39% | 920 | 83,41% |
YUI | 5547 | 2902 | 2645 | 47,68% | 920 | 83,41% |
excssive.com | 5547 | 2861 | 2686 | 48,42% | 924 | 83,34% |
cssminifier.com | 5547 | 2875 | 2672 | 48,17% | 925 | 83,32% |
cssdrive.com | 5547 | 2964 | 2583 | 46,57% | 934 | 83,16% |
minifycss.com | 5547 | 2894 | 2653 | 47,83% | 936 | 83,13% |
- embed image and/or sprites background-image
- Add vendor prefix
- More shorthands
- rgba(
- change hack throught html class
- -o- Opera
- -moz- Gecko (Mozilla)
- -webkit- Webkit (Chrome, Safari, Android...)
- -ms-/mso- (Internet Explorer)
- -khtml- KHTML (Konqueror)