I'm pretty sure just about everybody in the universe who codes c# has configured their code comments to be green. In fact, I don't know any language where people tend to color their comments in something other than a shade of green. Except on StackOverflow.

enter image description here

Please don't make the code narwhal sad. Change the CSS for code comments to a lovely shade of green! Like sea green, algea green, or maybe seaweed green.

  • 14
    Sad? More like preggers there.
    – random
    May 27, 2011 at 13:54
  • 8
    Sad, possibly pregnant and with dental problems. All the more reason to fulfill its wish, poor thing.
    – Pekka
    May 27, 2011 at 13:59
  • 5
    "I don't know any language where people tend to color their comments in something other than a shade of green". Er. Is this really a language thing? May 27, 2011 at 14:00
  • 4
    You comment your code? Good on you.
    – user7116
    May 27, 2011 at 14:04
  • 2
    @random: Code narwhal spends lots of time in his cubicle, drinking soda. He doesn't get much exercise anymore.
    – user1228
    May 27, 2011 at 14:15
  • 1
    @MichaelMrozek: Eh, I suppose not... More of an IDE default thing, I guess.
    – user1228
    May 27, 2011 at 14:16
  • 1
    Mine are gray, I use an theme derived from Expression. I wouldn't be opposed to the green, though.
    – squillman
    May 27, 2011 at 14:39
  • 2
    Mine are also gray, I'm using a custom Oblivion theme, so they blend better into the background (where comments belong, in my opinion, they should help, not distract from code). May 27, 2011 at 14:43
  • 1
    Wouldn't you know the freaks who don't have green comments would come out of the woodwork. Freaks.
    – user1228
    May 27, 2011 at 14:47
  • 4
    Now I'm opposed to the green.
    – squillman
    May 27, 2011 at 14:49
  • 3
    But...my comments are always in gray. I go out of my way to make them gray...
    – Swati
    May 27, 2011 at 14:52
  • 2
    @Swati: FREEAAAAAAK!!!!!
    – user1228
    May 27, 2011 at 15:02
  • 1
    The narwhal is not fat, or pregnant; it's just that outside the water the gravity has that effect. Or that, or we would be wearing a diving mask.
    – apaderno
    May 27, 2011 at 15:14
  • 4
    Is that a narwhal, or did a manatee and a unicorn have a love child?
    – user27414
    May 27, 2011 at 17:41
  • 1
    No, no, maroon is clearly the proper color!
    – SamB
    Jan 31, 2012 at 4:36

3 Answers 3


For your convenience, here's a quick and dirty userscript that changes the code comments color to green (only on Stack Overflow):

Green Comments

it does nothing more than simply adding this global style:

code span.com { color: green; }
  • Richard suggestion code span.com ensure that only code comments are highlighted correctly. May 27, 2011 at 15:23
  • @Loïc: I don't think that it's really necessary, as the current gray color is also defined on the global .com class in all.css on Stack Overflow, but I updated the script and my answer anyway ;-)
    – fretje
    May 27, 2011 at 15:36
  • +1 for doing work for me. However, I wish to impose my will over all, lest any narwhal be denied green comments, so no accept for you!
    – user1228
    May 27, 2011 at 15:44
  • 1
    @Won't: No problemo, the accept should indeed go to a permanent fix for everyone (I also don't like my comments gray), but in the mean time, it's at least a solution for some narwals out there...
    – fretje
    May 27, 2011 at 15:46
  • All of my unicorns approve this. Jan 31, 2012 at 10:53

If your browser (or extensions) are up to it applying a user style to the CSS selector

code span.com

will override the default styling.

  • 7
    Work? You want me to do work to fix this??
    – user1228
    May 27, 2011 at 14:46
  • Heinous. Simply, heinous...
    – squillman
    May 27, 2011 at 14:57
  • 1
    @Won't So you're on SO but so don't want a bit of (declarative) programming? :-)
    – Richard
    May 28, 2011 at 8:05
  • Well, fretje posted not only a whole rule but also some userscript to apply it. You could have at least written the rule, if not the mozilla-specific boilerplate to ensure it's used only for SE sites (which would anyway be likely to miss some of less-well-known 2nd-level domain names, e.g. askubuntu.com or stackapps.com).
    – SamB
    Jan 31, 2012 at 4:33

For those of a chrome persuasion, I've just put together a little extension to make the comments green.

You must log in to answer this question.