Jump to content
Search Community

Is it possible to animate a flexbox's gap property?

SteveS test
Moderator Tag

Recommended Posts

Having read some forum posts about the difficulties of animating flex properties, I still figured that the `gap` property would be tweenable given it is a numerical value, but I can't seem to. Is this a known gap in GSAPs abilities?

Link to comment
Share on other sites

  • 2 years later...

Welcome to the GSAP forum @Chiggsy

What have you tried so far?

Steve is right, since gap uses numeric values, it should easily be animatable.

Here is an example - note, that I set autoRound: false here, to smoothen things out a bit.

See the Pen gOQwgJZ by akapowl (@akapowl) on CodePen



 

https://greensock.com/docs/v3/GSAP/CorePlugins/CSSPlugin

 

autoRound

By default, CSSPlugin will round pixel values and zIndex to the closest integer during the tween (the inbetween values) because it improves browser performance, but if you’d rather disable that behavior, pass autoRound: false in the CSS object. You can still use the SnapPlugin to manually define properties that you want rounded.

 

  • Like 5
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...