mattbasta / crass

A CSS minifier and utility library for JavaScript
http://mattbasta.com/crass
MIT License
102 stars 6 forks source link

Attribute selector with numeric value must have quotes #68

Closed ibobo closed 6 years ago

ibobo commented 6 years ago

When a selector must match a numeric value, the value must be enclosed in quotes, or it won't work; in general you can remove quotes (as done in #44) only when the content is a CSS identifier:

In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit.

Thanks

mattbasta commented 6 years ago

Not sure when I'll be able to fix this but happy to review a PR if you write one. It should be a straightforward fix.

ibobo commented 6 years ago

I checked the code, and apparently the bug was already fixed in 0.12.1, but I was using an outdated version (0.11) without knowing it since I'm using gulp-crass and didn't see any entry in yarn outdated! Thanks for the feedback anyway!