Open coxrichuk opened 2 months ago
Class names in a selector can't start with a number. If you need a class name starting with a number, you need to escape it (for instance, using CSS.escape('123')
). The correct selector would be .\\31 23
.
You see the error Percent sign is expected
because currently, csstree uses the same parser for selectors and keyframe preludes, where a percentage is acceptable. According to CSS parsing rules, the tokenizer produces a number token from .123
, which instructs csstree to expect a percentage.
In short, yes, that's expected behavior.
Relevant to #178
If I attempt to validate a class selector that starts with a number I returned with a message of
Parse error: Percent sign is expected
My code looks like:
Is this expected behavior?