Applying animations by name with Sass

Author Posts

reachingmike

Hi,
I have a Div which contains an SVG image and some text.
I would like to use Sass and apply an animation to the image when it’s parent div is hovered.
Is there a native way to call the animations within sass code?
Thanks


Sebastian

Hey,

This sounds like something you would achieve with normal CSS code, which you can write alongside Sass. It would look something like this:

div:hover svg {
   animation: myAnimName .5s;
}

That could be a nested selector if using Sass, or before or after some Sass variables, functions, mixins etc.

Or have I misunderstood what you mean by call an animation?

Cheers,
Sebastian


reachingmike

Hi Sebastian,
Thats perfect. I was trying this but missing the .5s,
Thank you

You must login or register to reply to this topic.