csssvgcsslint

CssLint : Unknown property "fill"


I'm changing an SVG path color via css :

.compute .svg path {
    fill: #fff;
}

It works just fine, but when running cssLint over it, I had this warning:

Unknown property: "fill"

Is it a cssLint error? Or is it a bad thing to use this property in css to change the attributes of an SVG path?


Solution

  • No, it's not a bad thing, it's the right way to do it. cssLint doesn't support these properties. It's just one of its many issues. I suppose you could hack it: https://github.com/CSSLint/csslint/wiki/Working-with-Rules. See also this issue: https://github.com/CSSLint/csslint/issues/283.