2017 © Pedro Peláez
 

library cssqueeze

Efficient CSS minification in PHP

image

ianbogda/cssqueeze

Efficient CSS minification in PHP

  • Tuesday, December 30, 2014
  • by ianbogda
  • Repository
  • 5 Watchers
  • 10 Stars
  • 330 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 13 Versions
  • 2 % Grown

The README.md

License, (*1)

Build Status Code Coverage Scrutinizer Quality Score, (*2)

Latest Stable Version Latest Unstable Version, (*3)

SensioLabsInsight, (*4)

CSSqueeze …, (*5)

It's a single PHP class licensed under Apache 2 and GPLv2., (*6)

PHP

  • PHP 5.3
  • PHP 5.4
  • PHP 5.5
  • PHP 5.6

Features

  • 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

Compare few minifiers

ranking is by after compression and gzipped, after compression, (*7)

file compressed : 002/002.css from csszengarden.com, (*8)

  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%

Todo

  • embed image and/or sprites background-image
  • Add vendor prefix
  • More shorthands
  • rgba(
  • change hack throught html class

Vendors Prefix

  • -o- Opera
  • -moz- Gecko (Mozilla)
  • -webkit- Webkit (Chrome, Safari, Android...)
  • -ms-/mso- (Internet Explorer)
  • -khtml- KHTML (Konqueror)

The Versions

30/12 2014

dev-master

9999999-dev https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

14/10 2014

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

28/01 2014

1.3.0

1.3.0.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

28/01 2014

1.2.1

1.2.1.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

27/01 2014

1.2.0

1.2.0.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

27/01 2014

1.1.2

1.1.2.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

27/01 2014

1.1.1

1.1.1.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

22/01 2014

1.1.0

1.1.0.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

21/01 2014

1.0.1

1.0.1.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

20/01 2014

1.0.0

1.0.0.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

12/09 2013

v0.3

0.3.0.0 https://github.com/ianbogda/CSSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.3

 

by Yann Bogdanovic

css compression minification

23/01 2013

v0.2

0.2.0.0 https://github.com/ianbogda/csSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.1.4

 

by Yann Bogdanovic

css compression minification

23/01 2013

v0.1

0.1.0.0 https://github.com/ianbogda/csSqueeze

Efficient CSS minification in PHP

  Sources   Download

(Apache-2.0 or GPL-2.0)

The Requires

  • php >=5.1.4

 

by Yann Bogdanovic

css compression minification