Two SVGs on the same page interfering
See original GitHub issueIn some cases, when I import two different SVGs onto the same page, their styles interfere, and one image becomes distorted (or there’s an extra shadow, etc.).
For example:
import Tree from '-!svg-react-loader!../../images/tree.svg';
import Mountain from '-!svg-react-loader!../../images/mountain.svg';
The components are then rendered inline. Does anyone know how to make sure the SVGs don’t interfere with each other?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Two SVGs on one HTML page are affecting each other
I have the two SVG elements on the same html page. If I set the second SVG's value of svg/defs/clipPath/rect.width then it affects...
Read more >Display issue with 2 svg files on the same page - WordPress.org
I have set 2 svg images on that page. The first one displays over 992px page width and the second one under 992px....
Read more >5 Gotchas You're Gonna Face Getting Inline SVG ... - CSS-Tricks
The same idea holds true for any JavaScript manipulations on the SVG clone itself. ... Gotcha Two: Working With A Designer.
Read more >Cookbook - vpype documentation
This command will read two SVG files onto two different layers, then write them ... layer ID value n of 100 to avoid...
Read more >Migrating to v5 - Bootstrap
Track and review changes to the Bootstrap source files, documentation, and components to help you migrate from v4 to v5. On this page....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes! I had the same problem and the underlying cause has to do with the IDs in the SVGs. I have a created a fork of this that solves this problem and is very easy to use. One caveat: if you have two or more SVGs with the same exact name you will still get ID collisions and issues. Check it out here: https://github.com/SilverFox70/svg-react-loader
Any updates on this? I am having the same issue.