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

removeUselessStrokeAndFill fails at animations #1677

Open
cyberalien opened this issue May 30, 2022 · 0 comments · May be fixed by #2063
Open

removeUselessStrokeAndFill fails at animations #1677

cyberalien opened this issue May 30, 2022 · 0 comments · May be fixed by #2063
Labels

Comments

@cyberalien
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

const { optimize } = require('svgo');
console.log(
	optimize(
		`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
    <circle cx="12" cy="12" r="8" fill="currentColor" fill-opacity="0">
        <animate attributeName="fill-opacity" values="0;1" begin="1.2s" dur="0.4s" fill="freeze" />
    </circle>
</svg>`,
		{ plugins: ['removeUselessStrokeAndFill'] }
	)
);

Result:

{
  data: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="none"><animate attributeName="fill-opacity" values="0;1" begin="1.2s" dur="0.4s" fill="freeze"/></circle></svg>',
  info: { width: '24', height: '24' }
}

Notice that fill="currentColor" was changed to fill="none".

Expected behavior
Expected not to change fill because fill-opacity is being animated, so actual value of fill-opacity is not 0.

Desktop (please complete the following information):

  • SVGO Version 2.8.0
  • NodeJs Version 16.14.2
  • OS: macOS 12.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant