Normalize units in selector

This commit is contained in:
ConnorSkees 2020-01-18 10:26:29 -05:00
parent 31d8017a01
commit afef31b808

View File

@ -242,7 +242,8 @@ impl<'a> SelectorParser<'a> {
}
if let Some(Token { kind, .. }) = tokens.next() {
match &kind {
TokenKind::Ident(tok) => self.selectors.push(SelectorKind::Element(tok.clone())),
TokenKind::Ident(ident) => self.selectors.push(SelectorKind::Element(ident.clone())),
TokenKind::Unit(u) => self.selectors.push(SelectorKind::Element(u.to_string())),
TokenKind::Symbol(Symbol::Period) => self.selectors.push(SelectorKind::Class),
TokenKind::Symbol(Symbol::Hash) => self.selectors.push(SelectorKind::Id),
TokenKind::Symbol(Symbol::Colon) => self.consume_pseudo_selector(tokens),