Allow numbers in selectors

This commit is contained in:
ConnorSkees 2020-02-14 10:11:40 -05:00
parent f4c5fbae27
commit a7322e1ee8

View File

@ -276,7 +276,7 @@ impl<'a> SelectorParser<'a> {
} }
if let Some(Token { kind, .. }) = tokens.next() { if let Some(Token { kind, .. }) = tokens.next() {
match kind { match kind {
TokenKind::Ident(ident) => self.selectors.push(SelectorKind::Element(ident)), TokenKind::Ident(v) | TokenKind::Number(v) => self.selectors.push(SelectorKind::Element(v)),
TokenKind::Symbol(Symbol::Period) => self.selectors.push(SelectorKind::Class), TokenKind::Symbol(Symbol::Period) => self.selectors.push(SelectorKind::Class),
TokenKind::Symbol(Symbol::Hash) => self.selectors.push(SelectorKind::Id), TokenKind::Symbol(Symbol::Hash) => self.selectors.push(SelectorKind::Id),
TokenKind::Symbol(Symbol::Colon) => self.consume_pseudo_selector(tokens), TokenKind::Symbol(Symbol::Colon) => self.consume_pseudo_selector(tokens),