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

[INFO] weird defs behaviour while using svgo optimization gradients #195

Closed
salvaft opened this issue Jan 26, 2024 · 0 comments
Closed

[INFO] weird defs behaviour while using svgo optimization gradients #195

salvaft opened this issue Jan 26, 2024 · 0 comments

Comments

@salvaft
Copy link

salvaft commented Jan 26, 2024

What version of astro-icon are you using?

No response

Astro Info

Astro                    v4.2.5
Node                     v20.11.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         astro-icon

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Colors defined in defs like gradients not working properly

Looks like only the first one is considered. Related to: svg/svgo#1896 and https://svgo.dev/docs/plugins/cleanup-ids/
image

What's the expected result?

defs should mantain svg style

Disabling some svgo plugins fixes the issue

export default defineConfig({
  integrations: [
  icon({
      svgoOptions: {
        plugins: [
          {
            name: "preset-default",
            params: {
              overrides: {
                cleanupIds: false,
              },
            },
          },
        ],
      },
    })
],
    },
  })],
});

image

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-xzukxg?file=src%2Fpages%2Findex.astro

@salvaft salvaft closed this as completed Jan 26, 2024
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

1 participant