mahirshah / css-property-parser

Validate css properties and expand shorthand css properties
MIT License
60 stars 6 forks source link

This regex should be case insensitive #7

Closed chriseppstein closed 6 years ago

chriseppstein commented 7 years ago

When reviewing the change for capital hex values for colors I noticed that this lexer regex should be case insensitive:

https://github.com/css-blocks/css-property-parser/blob/acb0e516a7003072628c15e70d6fe5430d1a0bfd/src/constants/genericLexer.js#L4

It's not just the hex colors. even units can be uppercase or even mixed case E.g. 20dEg is a valid number for 20deg

chriseppstein commented 7 years ago

In general, CSS keywords, units, etc are all case insensitve. E.g. border-style: dAsHeD is totally valid. It would be good to do a scan of the current implementation and make sure this aspect is consistently implemented across the board.