Closed Moodycomputer closed 8 years ago
I've never had a problem controlling the fill of these icons. If you just set a fill
property it cascades down to the icon.
If fill is set on the icon as an attribute, it can't be controlled via CSS though.
For clarity, this use case is most prevalent when exporting from AI using the copy/paste method (copy icon from illustrator, paste in to text editor) where a lot of pruning is required either way. This may not be a common enough use case to be a major issue, but also isn't a large task. Small effort, small win?
Gotcha! prs welcome of course! I would rather spend cyclces updating a "build" to get from the .ai files to svgs and pngs to handle that case generally rather than take the effort to maintain the .ai files which seems harder to me. Might just be my developer talking sense I'm fairly bad at illustrator
Tangent: We probably should just have SVG files. Do we really need AI files?
@terracomma At least having the option to strip them out at build time would be good. I end up having to go back and do it manually.
FYI: I have a Sketch branch that uses extended svgo options to remove fills. https://github.com/IBM-Design/icons/tree/sketch
I'm confused, I took a random look at the svgs in the dist and they don't have fills. @kevinsuttle what is in that branch? Should it be merged into the build script?
It looks like a lot of the changes in there would be good for master, can you make a pr? I haven't researched all of the options you turned on
@mbarlock I'm still figuring it out. And @Moodycomputer I actually think that it's more flexible to set the fill to currentColor
and inherit the color
. https://github.com/svg/svgo/issues/561
Here we go! https://github.com/svg/svgo/pull/521
Awesome! I have that set by default in my style sheet. I do wonder if that is what we should be exporting by default though. What are other icon sets doing?
Who cares? Let's do the awesome thing. :)
Looks like this was resolved! Correct me if I am wrong.
Icons in the .AI files right now have a black fill. when an SVG is exported with from these, they get stuck with a
fill="#000000"
attribute. This makes it impossible to style the colors of these icons through CSS on the web.If the fill of the icons was switched over to registration, the fill attribute goes away and colors can be controlled through CSS.