proposal: css compression via aliasing

I'd like to propose a fairly simple compression specification for the next
revision of CSS. Statistics show that the majority of users to any site will
have an empty cache calling for a full down of assets like CSS. With the
proliferation of vendor specific prefixes along with CSS 2.1 it is very easy
to reach large file sizes (100+KB) causing an unnecessary bite into
bandwidth especially for "smart" hand held devices. GZip compression and
white-space removal goes a long way to reduce file size but a specification
for further size reduction like below would cut sizes down dramatically.

 

The proposal is simply to compress CSS via aliasing. Take for example this
common CSS (124 characters):

..myClass {

font-size: 35px;

font-weight: 700;

display: inline-block;

vertical-align: middle;

padding: 5px;

position: relative;

}

 

This could become the following through aliasing (47 characters):

..myClass {

fs: 35px;

fw: 700;

d: ib;

va: m;

p1: 5px;

p2: r;

}

 

Results:

Original: 124 characters

Aliased: 47 characters

Savings: 62%

 

The aliases don't need to be human readable, just unique in context, and
should be restricted to two characters if possible. Browsers that implement
the specification will simply map the alias and perform the same actions as
their full counterparts. Web developers can simply run their CSS through a
program that follows the alias specification to produce the aliased version
before publishing to the production web site. A browser header could be used
to determine if a web site should serve an aliased CSS file versus a
non-aliased one for browsers that lack the support for this new
specification.

 

Thanks,

Joey

Received on Wednesday, 9 October 2013 11:58:54 UTC