-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Option to pass the name of the svg being processed as a param into a plugin #623
Comments
+1. I recently added an auto prefixing feature for |
Even though I mostly don't have this issue these days ( we just started using attributes or inline styles when exporting svgs ), I'd still love to see this being natively supported in svgo. |
@bomberstudios: Recent svgo supports this now (#700). |
👏👏👏👏 |
Closing this since prefixIds plugin by @strarsis takes care of what I was originally trying to achieve. |
Is there any way to pass in the filename of the current svg into a plugin ?
The reason why i need this is because a lot of our svgs are exported from illustrator and have style tags with class names like
.st0 {} .st1 {}
. This causes a issues when we use a lot of svgs in a single page, as the styles get overriden.An easy way to solve this would be to replace a class like
.st0
to.svgName0
..which is why i need the file name. I'd also appreciate other ideas on solving this.The text was updated successfully, but these errors were encountered: