Some nice tips on writing sexy CSS

Jina Bolton, who's somewhat of a CSS guru it seems, writes about "sexy CSS". I liked her tips on "comment flagging" (basically making it easy to find headings within the css file), keeping author & timestamp information in the file, and some good ideas on how to organize your selectors. Interestingly, I differ with her on how she organizes her declarations: I like to keep mine ordered "naturally" - that is, as I add declarations for needed effects, they get appended to the end of the list. I like this method because it saves information about the important declarations.

She talks a little bit about css frameworks like YUI and Blueprint, but doesn't say much about them save that they are a "bit bloated" and often make the mistake of using non-semantic class names.

She also makes mention of a code convention that advocates one selector per line - a convention that I'm really fond of, and use, myself.

I am also reminded of the really great tools, like Textmate and CSSEdit that Mac users get but Windows users don't. :(

[Update: actually, it was pointed out to me that the E Text Editor is a clone of Textmate for Windows - it's even compatible with Textmate's bundles.]

No comments: