Google published an updated style guide in May.
Most things are standard I guess, but there are some oddities in there which may cause some of us to revisit our code and scratch heads - (see below for a few of them) but I suppose it's not a bad thing to have "the heavyweight" publishing a 'best practice' coding framework.
Here's the main page - http://code.google.com/p/google-styleguide/
Here's the JavaScript guide - http://google-styleguide.googlecode....criptguide.xml
and here's the one that most of us will be interested in, HTML/CSS - http://google-styleguide.googlecode....mlcssguide.xml
===========================
Things I noticed at first glance...
Property declarations should be alphabetized i.e.
Makes some sense I guess, but it will separate some declarations that I like to keep together; i.e. font-size, color, text-decoration etc.Code:#example { border: 1px solid #000; border-radius: 6px; display: block; font-family: sans-serif; margin: 1em; outline: 0; padding: 10px; text-align: center; }
Do not use quotes in url() or unit values after a zero,
Use short #abc hexadecimal color notation rather than #aabbcc,
Several mentions about cutting down on white space, but then they recommend indenting with two spaces rather than a tab - I always thought that a tab applied only one space?
There are plenty more in the guide and probably many I've missed, can you see any quirky ones?
Mike![]()

Reply With Quote