---- Google Publishes HTML and CSS Best Practice Style Guide
rlange - 2:24 pm on May 3, 2012 (gmt 0)
I think some of these suggestions are made with the unstated assumption that you'll be running your HTML and CSS through some deployment process that strips out everything that's unecessary for rendering. For example, "Mark todos and action items with TODO". I would never put TODO's in code that could be viewed by the public. It's useful internally, but the public doesn't need to know about it.
The "Indent by 2 spaces at a time" suggestion seems based on that assumption, too. Using tabs instead of spaces can result in significantly smaller file sizes, unless you strip out all unnecessary whitespace at some point in the deployment process.
lucy24 wrote: Are they nuts? I'm not writing a CSS index, I'm writing a stylesheet. Declarations are grouped thematically, so I can find them: existing tags (format of <a> links, <em>, that kind of thing) headers, paragraphs, lists, tables, character modifiers...
They're not suggesting you alphabetize your selectors. They're suggesting that you alphabetize the property declarations for your selectors.
AndyA wrote: I'm also concerned about not using closing tags for paragraphs, which as far as I know is still a recommended practice.
Seeing their code examples without closing paragraph tags bothered me, too.
zdgn wrote: Besides, I think some of Google's silly 'guidelines' - rule sorting or unminifieds or "meaningful" annotations - are plain self-serving to Googlebot [...]
In what way? It's not like Google can't sort CSS properties once they've been parsed; it's a trivial process to automate at that point.