Open kubiqsk opened 3 years ago
Only an external currentColor
is not supported. svgcleaner has no way of knowing it.
In theory, we could try preserving it, but it is complicated.
It doesn't need any context, it's like CSS variable and it's working everywhere https://caniuse.com/?search=currentColor
currentColor is applied from the closest parent element which has some color
so when you use SVG on web eg. for icons in buttons, then it should load color from button text and on hover (mouseover) it should change with text color
next usecase is switching color themes etc... there are many scenarios like that
your validator should just skip this, ignore it or maybe you have some whitelist there? I didn't really investigate your source code
As I've said, this is not supported and hard to implement. svgcleaner is designed for self-contained SVGs.
currentColor is one of the most used colors in web SVGs, it's definitely not invalid color, so please allow this
Thank you for a great app