Open digitalacorn opened 2 years ago
@anncwb Hi - Please could you run this trivial update through the workflow for a patch update
@anncwb I need this too. Can you take a look at this pr? Thanks.
+1
I believe this is not in the scope of this plugin. The expected logic should be handled by an SVGO plugin
I believe this is not in the scope of this plugin. The expected logic should be handled by an SVGO plugin
Thanks for the reply - it seems colours are replaced by this module /after/ the SVGO stage. How do you propose this is solved by the SVGO options?
I have published a forked version which supports disabling the replacement of the stroke colour. https://www.npmjs.com/package/@digitalacorn/vite-plugin-svg-icons
This should be merge
This should be merge
This is annoying, been playing with svgo options and it drove me mad, only to find out the issue was in this plugin all along.
Hey @anncwb, could you please take a moment to review that MR and merge it? If there are any additional changes or adjustments needed, I'm more than willing to collaborate further to ensure its seamless integration into the project. I hope @digitalacorn also could help.
Here is a little example of inconsistency, that the default behavior of the plugin produces: in the USA SVG flag, it makes white stripes black. And it's not possible to fix it, rather than passing color: #fff
, which is not something that I want to do, since the fill color shouldn't be always #fff
- there are more flags with not only white strokes. It also affects 17 more flags from one popular library with SVG country flags.
Black USA flag (the stroke was replaced with currentColor
):
Proof that not only white color is used as a stroke:
Is there any chance you can merge the changes and deploy a new version of your plugin?
Expose an option to enable or disable the replacement of the stroke colors within the SVG content.
Default behaviour remains the same