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

<svg> className is removed #23

Open
groenroos opened this issue Feb 19, 2021 · 0 comments
Open

<svg> className is removed #23

groenroos opened this issue Feb 19, 2021 · 0 comments

Comments

@groenroos
Copy link

If the <svg> tag in the image being loaded has a class, this will be overridden when the SVG is inlined:

SVG file

<svg class="someclass" xmlns="http://www.w3.org/2000/svg" width="53" height="27" viewBox="0 0 53 27">
    <circle cx="26.5" cy="13.5" r="8" fill="#FFF" fill-rule="evenodd" />
</svg>

Expected outcome

<svg class="someclass svg inlined-svg" xmlns="http://www.w3.org/2000/svg" width="53" height="27" viewBox="0 0 53 27">
    <circle cx="26.5" cy="13.5" r="8" fill="#FFF" fill-rule="evenodd" />
</svg>

Actual outcome

<svg class="svg inlined-svg" xmlns="http://www.w3.org/2000/svg" width="53" height="27" viewBox="0 0 53 27">
    <circle cx="26.5" cy="13.5" r="8" fill="#FFF" fill-rule="evenodd" />
</svg>

I know as a workaround I can define the class in the <img> tag and it'll be retained, but this seems redundant/inconvenient.

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