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

cleanupEnableBackground should remove inline styles too #1740

Closed
jdufresne opened this issue Jan 19, 2023 · 0 comments · Fixed by #1866
Closed

cleanupEnableBackground should remove inline styles too #1740

jdufresne opened this issue Jan 19, 2023 · 0 comments · Fixed by #1866
Assignees

Comments

@jdufresne
Copy link
Contributor

jdufresne commented Jan 19, 2023

Is your feature request related to a problem? Please describe.

Given the SVG:

<svg height="100" width="100" style="enable-background:new 0 0 100 100"><circle cx="50" cy="50" r="40" stroke="#000" stroke-width="3" fill="red"/></svg>

Command:

npx svgo --multipass ciricle.svg 

Actual: svgo makes no change.

Describe the solution you'd like

Expected: The cleanupEnableBackground plugin should remove enable-background and the style attribute.

Describe alternatives you've considered

I have removed these style manually from my SVG assets.

Additional context

Adobe Illustrator injects this style attribute into SVG files.

MDN has this style marked as deprecated and unsupported:

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/enable-background

Note: As a presentation attribute, enable-background can be used as a CSS property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants