MMF-FE / svgicon

SVG icon components and tool set
https://mmf-fe.github.io/svgicon
MIT License
922 stars 95 forks source link

Using with Material icons: obliterates fill setting that Material icons relies on #90

Closed callumflack closed 5 years ago

callumflack commented 5 years ago

Material icons rely on aligning the icon artwork within whitespace using an empty path, like this:

<path fill="none" d="M0 0h24v24H0z"/>

However, this library adds an underscore to all fills when it compiles a folder of icons: any fill becomes _fill. Which means that every Material icon appears in the DOM as a box filled with the currentColor.

This is not a game-breaker. A quick find/replace works just fine (which is better than manually setting an array of colours per icon).

Just wondering if there's a way to avoid underscoring fill on every compilation?

Allenice commented 5 years ago

You can use original prop to use default colors. If you want to use original colors, you can use isOriginalDefault plugin option.

refs:

callumflack commented 5 years ago

Thanks, this solved my problem.