PDA

View Full Version : Clean CSS


Mystic
03-17-2007, 03:10 AM
CleanCSS is a CSS Formatter and Optimiser (based on csstidy 1.1).

Why optimize?

Well for two reasons mainly. It helps you get smaller CSS file sizes and better written code. The way the optimizer works actually lets you decide how much compression you want. From super compressed (virtually unreadable and editable by a human being) to visually pleasing. I prefer the standard setting because it gives you a little of both.

Another cool feature is that it helps you with shorthand coding. I am by no means an expert at CSS. I do not have all the shorthand methods memorized (yet!). For those of you using Dreamweaver, like myself, you'll find that it likes to use longhand code. By this I mean putting each seperate rule on it's own line. This can get tedious copying and pasting it make a small change. A lot of that stuff can get consolidated into one line, like backgrounds and borders.

So your main reasons for wanting to optimize are to make sure your CSS files are clean. There is a certain art form in clean and concise code. And I'm not even a programmer and I can see that. I'm an artist, so this tool really helps speed things up.

http://www.cleancss.com

boron
03-17-2007, 03:51 AM
Can't comment above tool since I'm not familliar with the CSS, but I want to ask:

Yahoo Home page is full of images and other "elements", but the page size is still only 5Kb (!!!) (http://www.websiteoptimization.com/services/analyze/wso.php?url=http://www.yahoo.com/). How they did that?

Mystic
03-17-2007, 12:30 PM
Its not 5kB.

I saved the page on my computer and it was 278 KB.

boron
03-18-2007, 11:28 PM
I also downloaded Yahoo Home page and checked the size in Windows Explorer - it's 120 KB.

Copy-paste from the speed test from my previous post:

TOTAL_SIZE - Congratulations, the total size of this page is 5323 bytes.


I've heard that "image chasing" is probably used to diminish the Home page size.

Submerge
03-18-2007, 11:57 PM
Wow, thanks for the program. That should help a little. But with the speed of connections, I'd think it would be worthless to worry about a couple extra kilabyte from whitespace, etc. But it would be nice for good readability.

Breakpoint
03-30-2007, 12:14 PM
wow nice program, will help keeping things clean