I think the best reference would be the actual (main) spec since the grammar spec says it is kind of a "superset" of the actual specification, i.e. not always strict enough. Identifiers are specified here: https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#va... (two hyphens at the start are also not allowed, in contrary to the "SO answer" cited).