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
Non unique ids cause rendering collisions when svgs are inlined #1045
Labels
Comments
What kind of change is required.. I think we have unique ids everywhere. |
Here is an example for ag.svg: @@ -1,10 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-ag" viewBox="0 0 512 512">
<defs>
- <clipPath id="a">
+ <clipPath id="ag-a">
<path fill="#25ff01" d="M109 47.6h464.8v464.9H109z"/>
</clipPath>
</defs>
- <g fill-rule="evenodd" clip-path="url(#a)" transform="translate(-120 -52.4) scale(1.1014)">
+ <g fill-rule="evenodd" clip-path="url(#ag-a)" transform="translate(-120 -52.4) scale(1.1014)">
<path fill="#fff" d="M0 47.6h693V512H0z"/>
<path d="M1.5 48.2h690.9v196.2H1.5z"/>
<path fill="#0061ff" d="M128.3 232.1h458.5v103.4H128.3z"/> |
Here is a script I used to update flags: agatanga/flags#2 (comment) |
We are running into the same problem. Non-unique ids mess up the flags if you show more than one. A fix would be much appreciated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some flags are corrupted when SVG icons are inlined into the page HTML.
Codepen: https://codepen.io/vovayatsyuk/pen/eYrPXgW?editors=1000
Screenshot:
Possible solution
Use unique ids to prevent collisions. I've already done that in my laravel package
If you are interested in this change I'll open PR with updated icons.
The text was updated successfully, but these errors were encountered: