Follow me on Twitter!

Dont Trust This Guy why not take my word for it? A blog by Jim Jeffers

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.

CSS Comments Textmate Bundle

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.

11 Responses to This Article.

  1. Patrick Says:

    Thanks for this excellent bundle.

  2. Julian Schrader Says:

    Thanks, this is great!

  3. The Brian Shaler Blog » ReadPhoenix: Top Blog Posts of the Week #4-5 Says:

    [...] Blog: DontTrustThisGuy.com Author: Jim Jeffers Company: Sitewire Post Title: CSS Commenting With Textmate [...]

  4. WMS Says:

    Sweet tutorial, just what I have been looking for.
    I have added you to Stumbleupon.

  5. Jim Jeffers Says:

    @WMS - Thanks!

  6. Ikki Says:

    Great tutorial indeed :) I’ve bookmarked it for future references! Thanks for sharing this stuff!

  7. Don Says:

    Commenting is key in any design firm especially when multiple developers work on the same project, thanks for the tutorial!

  8. Modified CSS Bundle for TextMate — The Only James Says:

    [...] you’re coding for the web you’ll probably have at least tried out Jim Jeffer’s CSS Bundle, which was inspired by an article by Jina Bolton. If not check it [...]

  9. James Conroy-Finn Says:

    Thanks for sharing Jim!

    I like the plugin. I did tweak it slightly as it required me to keep typing the current date and time as well as my name when I added “updated” comments. I’ve blogged the changes I made (you can find them at http://www.theonlyjames.com/2008/07/tm-css-bundle-mod/) and pasted my amended “comment: updated” snippet below.

    /*
    ${1:Working Title}
    Updated: ${2:`Date +’%a’`} ${3:`date +’%d/%m/%Y’`} @ ${4:`date +’%H:%M:%S %Z (%z)’`}
    Author: ${5:`dscl . -read /Users/$USER RealName | awk ‘NR==2 { sub(/^[ \t]+/, “”); print }’`}
    —————————————————-*/$0

    Hope you don’t mind me linking to your post.

  10. Jim Jeffers Says:

    Hey James,

    Thanks for the revision! I’m going to update the bundle with your revision tonight. That’s great!

  11. Richard Says:

    Thanks for this bundle this is great.

Leave a Reply

Meta Information

This post was filed under design and tagged with: , , , , .

This Post as a Feed

The content of this post and it's comments can be subscribed to as an RSS feed.

DontTrustThisGuy.com and all contents copyright 2003-2007 by Jim Jeffers, unless otherwise noted.Written in valid XHTML and a participant of XFN while being powered by WordPress
Contents under Creative Commons License. Visual design, layout and Cascading Style Sheets may not be reused without permission.
Entries (RSS) and Comments (RSS)