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

symbol are removed even when they're used in styles #1726

Open
nhoizey opened this issue Dec 13, 2022 · 1 comment · May be fixed by #2056
Open

symbol are removed even when they're used in styles #1726

nhoizey opened this issue Dec 13, 2022 · 1 comment · May be fixed by #2056
Labels

Comments

@nhoizey
Copy link

nhoizey commented Dec 13, 2022

Describe the bug

SVGO removes symbols from the SVG even when they're used in styles.

To Reproduce

With this SVG image: https://nicolas-hoizey.photo/ui/logo.svg

SVGO CLI with default configuration removes the <symbol>s, even if they're used in the styles, to make the logo responsive.

It doesn't remove the symbols with this configuration removing the inlineStyles plugin:

module.exports = {
  plugins: [
    {
      name: 'preset-default',
      params: {
        overrides: {
          inlineStyles: false,
        },
      },
    },
  ],
};

Expected behavior

symbols should be preserved, as they're useful in the image.

Desktop (please complete the following information):

  • SVGO Version 3.0.2
  • NodeJs Version 19.0.1
  • OS: macOS 13.0.1

Additional context

I tried first to optimize my SVG in SVGOMG and got the issue, which I referenced here:
jakearchibald/svgomg#417

@nhoizey nhoizey added the bug label Dec 13, 2022
@johnkenny54
Copy link
Contributor

I think this is related to issue #1834 and resolved by PR #2056 - media queries were being removed by inlineStyles.

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.

2 participants