About CSS Optimiser

This tools takes in a CSS file, and parses and outputs a leaner version, removing any redundancies and attributes which are not needed.

This tool started out as simply something to reformat CSS files. Often I would view source on a CSS example or site, only to see the CSS was all on one line and hard to read. From there it developed into what it is today.

A large amount of people seem to think this is just a white space remover. It's much more than that, and you can help to make it better. If the outputted style sheet has any error, then I would appreciate it being reported using the contact page. Any suggestions are also appreciated.

What it does

  • Removes comments
  • Removes white space (such as excess spaces)
  • Converts RGB values to Hex (they're smaller)
  • Converts Hex values in the format #RRBBGG to #RGB.
  • Changes zero values with a size specified to 0. (0px would change to 0)
  • Changes values such as border: 1px 2px 1px 2px; to border: 1px 2px;
  • Converts multiple background, font, margin, padding, list attributes into a single attribute
  • Converts multiple border values into single attributes
  • Option to convert absolute values (PX & PT) into relative values (EM)
  • Groups style attributes and values which appear mutliple times into a single style

Experimental

There are a couple of experimental options, these are marked with a *.

The borders option seems to work flawlessly now, but I have my reservations wether or not it works in most cases (I would appreciate feedback on how it went if you tried this option).

The group styles, in most cases will reduce the style sheet size. It works on a “there abouts” way of determining if combining values into a single style will save space or not.

Future

*Shrug* If you have any ideas then please contact me.

No additional information.

you are here: home » css » optimiser » about

Home
Style
PHP
 

Java SQL Converter : top ↑ : contact - All content and images copyright ©2002-2009