Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
espadrine opened this issue Jan 8, 2014 · 5 comments
Closed

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

espadrine opened this issue Jan 8, 2014 · 5 comments

Comments

@espadrine
Copy link

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.)

espadrine added a commit to badges/gh-badges that referenced this issue Jan 8, 2014
This change was considered more legible by at least two folks.
<badges/shields#95 (comment)>

Also, the shadow isn't black in order to circumvent a bug in SVGO.
<svg/svgo#168>
@deepsweet
Copy link
Member

@silentroach, is this was fixed in #165/#166 as well? if so, it will be available in the next patch version.

@espadrine
Copy link
Author

@deepsweet That's great news! (The above test case is on the latest v0.4.3.)

@staabm
Copy link

staabm commented Jan 8, 2014

Maybe it would nevertheless make sense to add a unit test for the above request

@silentroach
Copy link
Contributor

@deepsweet yep, didn't see this issue
@staabm added in #165

@deepsweet
Copy link
Member

ok :) v0.4.4 is coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants