Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing default SVGO settings #18

Closed
larsdood opened this issue Oct 23, 2018 · 1 comment
Closed

Changing default SVGO settings #18

larsdood opened this issue Oct 23, 2018 · 1 comment

Comments

@larsdood
Copy link

Hi,

Love your plugin and it's working wonders for the project I'm working on.

I only had one issue that rendered svgs that had more than one class defined in styles look completely awful. After almost two days of trying to fix or work around the problem, I finally found out that inlineStyles takes an object with a prop onlyMatchedOnce that is by default set to true if inlineStyles only gets true. By setting it to false, suddenly everything works perfectly. The SVGO documentation is not very good for pointing out that this work, so I had to look around in random source code files for SVGO to find this.

For anyone else looking to implement html-webpack-inline-svg-plugin with minimal configuration how about setting inlineStyles: { onlyMatchedOnce: false } for default value? I cannot for the love of me understand why the SVGO guys figured hiding that prop is a good idea, because some projects with complicated svgs and several classes defined inside a style-tag is going to have the exact same problem.

@theGC
Copy link
Owner

theGC commented Apr 27, 2020

I haven't had a chance to look into this so closing for now but if anyone else finds this issue and agrees please push a PR with the required update.

@theGC theGC closed this as completed Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants