CSS Commenting With Textmate
Last month Jina Bolton wrote an excellent article about Sexy Stylesheets on Think Vitamin. I was particularly impressed with some of the ideas for commenting more efficiently. The problem was, even after knowing the techniques, I was too lazy to comment consistently. That's where TextMate came in handy.
My CSS Comments Bundle For Textmate
I was surprised that there was nothing in the included CSS bundle for basic commenting so I took the liberty to write one. I also made tab triggers for all of the techniques shared in Jina's article. It's broken down into five snippets:
- Comment: a traditional CSS comment.
- Section: I chose to use the section flagging technique as mentioned in Jina's article.
- Colors: a reference table for defining hex colors used in your stylesheet. This was mentioned by Jina which she accredited to Steve Smith.
- Declare: a wordpress theme declaration. I found this to be a substantial way to define a stylesheet while following an established best practice by the wordpress community.
- Updated: this is the timestamp technique mentioned in Jina's article.
I prefer to use the declare snippet on my main stylesheet and the updated or timestamp on all of my included child stylesheets. This bundle has been in use by me for three weeks now and I've actually found it to help me a lot. Putting in comments for organizational purposes; I'd be too lazy to do it without this. Your mileage may vary with the bundle, but I hope you find it useful too.