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

Nuxt-Icon keeps adding classes to non-icon svgs imported #107

Open
hhhhaaarry opened this issue Oct 3, 2023 · 3 comments
Open

Nuxt-Icon keeps adding classes to non-icon svgs imported #107

hhhhaaarry opened this issue Oct 3, 2023 · 3 comments

Comments

@hhhhaaarry
Copy link

Hi, i'm using nuxt-svgo to import svgs as components, and i also have nuxt-icon for icons. The issue here is that if i use nuxt-svgo to import an svg as a component, nuxt-icon adds .nuxt-icon and .nuxt-icon--fill classes, and overwrites my svg colors

@atinux
Copy link
Member

atinux commented Oct 25, 2023

Could you please open a reproduction / sandbox?

@StevenJPx2
Copy link

StevenJPx2 commented Oct 30, 2023

same issue here.

Will post a repro soon. Commented for visibility.

@ImEins
Copy link

ImEins commented Apr 12, 2024

Same issue.

UPDATE :
I'm also using svgo-nuxt, and I was trying to dynamically load the svg.
In order to fix the issue you need to specify a filled property, Ex: <SvgoTest :filled="true" />

But I had to give up the first option since I couldn't change the svg width & height. What I end up doing is adding this to the nuxt.config.ts in order to stop using the nuxt-icon component :

  modules: [      
    [
      'nuxt-svgo',
      {
        defaultImport: 'component',
      },
    ],
  ],

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

No branches or pull requests

4 participants