csstools / sanitize.css

A best-practices CSS foundation
https://csstools.github.io/sanitize.css
Creative Commons Zero v1.0 Universal
5.22k stars 312 forks source link

SVG Rule is breaking #139

Closed rumkin closed 6 years ago

rumkin commented 7 years ago

SVG Rule is not what I'm expect it to be. It doesn't reset it overwrite current behavior at all.

I have dynamically created component which has fill property set to different colors. But css's color is black and all svgs became black. I could not modify it with direct css rule and could not turn off sanitizer's rule somehowe. I think such behavior should be hidden behind some class name.

contactjavas commented 7 years ago

Yes, i also experience this issue when using RateYo!. All the rating stars become black :D.

Because this is fundamental, i think this rule should be removed:

/**
 * Change the fill color to match the text color in all browsers (opinionated).
 */

svg {
  fill: currentColor;
}
jonathantneal commented 6 years ago

This rule is easily overridden, so I would rather leave it as a sensible default. Based on feedback and sometimes the lack thereof over the last year, mapping fill to currentColor has resolved more hangups than it has created.