codefeathers / rollup-plugin-svelte-svg

Import SVG files as Svelte Components
MIT License
76 stars 12 forks source link

Change svg color #15

Closed stevecode21 closed 3 years ago

stevecode21 commented 3 years ago

Is it possible to change the color(fill) of a SVG in this package?

Iyongbudiarso commented 3 years ago

You can add attribute fill, use like this

import IconInstagram from '../icon/instagram.svg';
...

<IconInstagram fill="red" />
MKRhere commented 3 years ago

That's indeed how you do it :) All props will be passed down to the svg element.