Share Posted November 5, 2018 Hi, GSAP magicians, I am having trouble with animating a path of a SVG that is referenced as symbols. The codepen shows a left side, where the SVG is implemented "regularly" in the DOM flow. There, the intended animation works (the rectangle needs to be hovered). The same thing should happen on the right side, where the SVG is referencing a symbol instead. Does anybody of you guys know what I am doing wrong? The console shows that the original SVG is "copied" to a shadow-root - can "shadow DOM" be accessed anyway? Much appreciated! Thanks! See the Pen mQyvrX by rowild (@rowild) on CodePen Link to comment Share on other sites More sharing options...
Share Posted November 5, 2018 I don't think you can target fragments in the shadow DOM. Please read this article https://tympanus.net/codrops/2015/07/16/styling-svg-use-content-css/ 5 Link to comment Share on other sites More sharing options...
Author Share Posted November 5, 2018 @Carl Thank you for clearing that up for me and for pointing me to that great article! Much appreciated! Link to comment Share on other sites More sharing options...
Share Posted November 5, 2018 @Robert Wildling, Good article @Carl! Also, a tip, when animating symbols, or sprites, it is vary useful to use CSS Custom Properties, so that you can animate a specific instance of the symbol or sprite, rather than all of them at once. See the Pen YOWoEa by elegantseagulls (@elegantseagulls) on CodePen 6 Link to comment Share on other sites More sharing options...
Author Share Posted November 6, 2018 @elegantseagulls Nice!!! Thanks for sharing! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now