Skip to content

Optimized out fill="#000" despite <g> shadowing #168

Closed
@espadrine

Description

@espadrine

Reproducible with the following code.

var SVGO = require('svgo');
var svgo = new SVGO();
svgo.optimize('<g fill="#fff"><text y="20" fill="#000">Foo!</text></g>', function(res) { console.log(res); });

Output:

<g fill="#fff"><text y="20">Foo!</text></g>

Desired output:

<g fill="#fff"><text y="20" fill="#000">Foo!</text></g>

In that case, the fill shadows the fill performed by the <g>, which has the effect of making the text invisible, when it should be black.

(Obviously, this is a contrived example given as the reduced test-case of a larger image.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions