ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
257 stars 35 forks source link

Is there a way to keep original colors #145

Open noradroid opened 4 months ago

noradroid commented 4 months ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

All colors are removed from the icon svg content and replaced with "currentcolor"

Expected behavior

Provide a toggle / functionality to prevent colors from being replaced from the svg content for specific svg files only.

What is the motivation / use case for changing the behavior?

For the most part, having the icon color replaced with a currentcolor variable provides the ability to apply different colors to each icon. However, I have some specific icons that have gradients in them through \<stop> elements, and I would like to keep those gradients instead of having them all replaced by the same color.

I understand that I can just manually update the color within the .ts files, however they would just be replaced everytime the svg-generator runs.

Environment


Angular version: 16.2.12


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX