mattbasta / crass

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

Bad selector produced #67

Closed sanmai-NL closed 6 years ago

sanmai-NL commented 6 years ago
crass in.css --optimize --O1 --min ie10 > out.css
a[href^="tel:"]::before {
    content: "πŸ“ž ";
}
a[href^=tel:]:before {
 content:"πŸ“ž "
}
sanmai-NL commented 6 years ago

Same without --01.

mattbasta commented 6 years ago

This is fixed in 0.12.1.

sanmai-NL commented 6 years ago

@mattbasta:

Quotes are stripped from this:

div.status[data-valid="0"] {
    background-color: #e9bdb2;
}

And I verified the style isn’t applied because of that, at least in Firefox Developer Edition 59.0b7 (64-bit). Attribute selectors don’t always require quotes, so this seems to be a Firefox bug then. Is there a way to prevent crass from making this optimization?

mattbasta commented 6 years ago

Can you confirm which version of crass you're using?

sanmai-NL commented 6 years ago

0.12.1

mattbasta commented 6 years ago

I've pushed version 0.12.2, which has a more conservative regexp.