mathiasbynens/mothereffingcssescapes — Issue #3: `class="--foo"` needs escaping
Author: mathiasbynens
Created: 2011-10-14 19:36:45+00:00
State: open

http://mothereffingcssescapes.com/#--foo

To target elements with `class="--foo"` it seems you need to escape the selector as `.\--foo` (well, either one of the hyphens will do).

From :

> Pro tip: the hyphen-minus character (`-`) only needs to be escaped _once per selector_, and only if no other characters are used in the ID or classname _or_ if the ID or classname starts with multiple hyphen-minus characters (e.g. `--foo`). For example, to target the element with `id="-​-​-"` you would use `#\-​-​-`, but to target the element with `id="-abc"` you could just use `#-abc`.

OTOH, `class="foo--bar"` is fine.