Is there a reason to use uppercase letters for hexadecimal CSS color values?

It really doesn't matter, but what is important is having a convention and sticking with it. I like to use strict sass-lint rules to enforce lowercase hex values, and short values where possible (e.g. #fff instead of #ffffff).

Here are my reasons for choosing lowercase;

  • Easier and faster to type (I have changed the key bindings of my caps key and using shift is just awkward, especially mixing numbers and letters)

  • It's easier to search for something if you know what to expect. (Say you're rewriting old code to Sass, you've fixed all occurrences of #aa99cc, but what about AA99cc, Aa99CC, A9C, a9c? Linting will pick out these problems for you)


I am not aware of any differences other than personal preference. Personally, I prefer lowercase since it's quicker to read, although in very short strings such as CSS color values, the benefit is probably negligible. Really, I think it's just because I think lowercase looks better.

Hexadecimal, however, is traditionally written in uppercase, so maybe I'm - strictly speaking - in the 'wrong'.