Today I stumbled across a post comparing online CSS compression services. More mobile devices support more advanced CSS, so I got to thinking: how could we make mobile CSS work better in Skweezer? Currently it’s either “on” or “off.” I read over the PHP code in the recommended service (very nice!) and I see that it does the following:
- Remove comments and whitepace
- Optionally convert colors to hex values, and shorten hex values where appropriate
- Remove zero measurements
- Sorts the CSS and combines identical selectors
- Combines properties
- Combines or removes empty rules
Because Skweezer also mangles optimizes the original HTML as well, I was thinking that in addition to the above compression techniques, Skweezer has the latitude to do the following operations:
- Remove all properties related to position or advanced CSS that phones can’t use
- Detect and remove browser-specific CSS hacks
- Compress the selector names themselves using a hex identifier
- Embed the CSS in the page if short enough? Not sure on this one…
(Oops, forgot to post this. Moving from “draft” to “published”. Sigh…) One of my high school teachers once told me that he didn’t plan on teaching his son how to type because it would only be a year or two before we’d be interacting with computers by speech and they’d stop including keyboards. In his opinion, typing would shortly become a quaint anachronistic skill. Oh well for that.


