CleanCSS is a powerful CSS optimizer and formatter. Basically, it takes your CSS code and makes it cleaner and more concise. For optimization CleanCSS is using CSSTidy - an opensource CSS parser and optimiser.
Why optimise
CSS Optimiser reduces the size of CSS file more than 30% depending on various conditions, it causes faster loading pages and lower traffic costs.
How optimization works
- Convert Values of CSS property into shorthand notations,
e.g margin:1px 1px 1px 1px; becomes margin:1px; - All unnecessary whitespace is removed
- Comments are removed
- The last semicolon in every block can be removed
- All duplicate properties are merged,
e.g h1,h2,h3{color:##FF0000} - colors like “black” or rgb(0,0,0) are converted to #000000 or rather #000 if possible. Some hex-codes are replaced by their color names if they are shorter.
One Response
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Continuing the Discussion