nuxt/icon

Double svg tag when using custom collection

mfazail opened this issue ยท 3 comments

Project deps

"nuxt": "^3.11.2",
"nuxt-icon": "^1.0.0-beta.4"

Problem

When i use custom collection the generated svg code contains double tags something like ๐Ÿ‘‡

<svg ...>
    <svg ...>
          <path  ... />
    </svg>
</svg>

Stackblitz

Reproduction link

Screenshot

Svg Mode

image

Css mode

image

Screenshot 2024-05-25 at 16 44 27

Same here, they also get cropped constantly, even if the viewbox size is the same as in the config

If this works for someone I was having the same error about the icon getting cropped so I removed width and height from my own svg and now its fine. @alvarosabu this could help you.

@joseanzacarias hi,
I have tried what you said but for some reason it doesnโ€™t work on all svg.