
7 Principles Of Clean And Optimized CSS Code - sant0sk1
http://www.smashingmagazine.com/2008/08/18/7-principles-of-clean-and-optimized-css-code/
======
KevBurnsJr

      margin: { 10px 20px 30px 40px; } 
    

lol, wat? that's not even proper syntax.

Good intentions and a few good practices, but not a great understanding of the
deeper issues involved in maintaining stylesheets for large sites with
multiple contributors.

I would add :

    
    
      - Automate rollups and minification as a part of the build process
      - Outline the structure of the CSS in comments at the beginning of each CSS document.
      - Don't worry about whitespace cause you're going to minify it anyways.
      - Browser-specific CSS files can work against you.
      - Well written CSS often requires little documentation.  Focus on creating attributes that make sense. Nobody wants to RTFM.

~~~
thaumaturgy
I about vomited when he claimed that CSS files alone were exceeding 30KB. I'm
still a little sick to my stomach. :-(

Does that really happen? Are conditional comments and CSS hacks really
absolutely necessary? I've done a fair bit of CSS drudge work, including for
some moderately complicated layouts (and hated every moment of it), and never
resorted to either. There always seems to be a better way if I think about it
hard enough.

The tips were ... eh.

But I did really really like the graphics that he used in his examples, with a
page from the site folding back to reveal the code underneath. That was sexy.

EDIT: Hell, all the JS for the photo gallery at
[<http://davidmckayphotography.com/>], combined, is just a shade over 30KB,
and it does some fairly heavy lifting. I really hope the guy was kidding about
30K of CSS.

~~~
jdelsman
It's not uncommon for files for enterprise sites to exceed 30KB. Ours is about
45KB, but we have some work to do on it. Oh, and we call customizations for
our other clients, too. Keep in mind, that this is an uncompressed file, which
does need pruning, rollups and compression.

