Per CSS 2.1 it is invalid grammar for an identifier and the rules are the same in the lastest CSS3 (see the "railroad tracks") recommendation. Here are the relevant rules for CSS 2.1:
ident -?{nmstart}{nmchar}*
nmstart [_a-z]|{nonascii}|{escape}
nmchar [_a-z0-9-]|{nonascii}|{escape}
An identifier can start with an optional -
(0x2d); the second character is from the restricted nmstart
and cannot be a -
or an ASCII digit.
Browsers that accept --foo
as an identifier are using "more relaxed" rules (classify as desired).
If really wanting to get technical/fancy/confusing, any Unicode character with a CP higher than 0x240 can be used as the second character as it conforms to {nonascii}
- this includes a wide range of hyphen/minus-like characters. YMMV on browser interoperability and sustainability:
<div class="button ––small —red"></div>
Please don't do this: the first is two EN DASH (0x2013) characters, the latter is a single EM DASH (0x2014) character. Good luck debugging selectors/code with either.