Content pfp
Content
@
0 reply
0 recast
0 reaction

jake pfp
jake
@jklb.eth
Getting back into motion land for a bit and trying to get up to speed with all the things! Anybody know if framer-motion will allow me to use CSS variables to define my transition configs (stiffness, damping, etc)? I know I can use CSS vars for animated values, but not having luck using them for my configs…
4 replies
0 recast
5 reactions

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
CSS variables are inheritable/overridable CSS properties, so if this were possible Framer Motion would have to constantly watch the element for changes to each variable’s computed value. Probably overkill for configuring a spring animation which needs to be calculated frame-by-frame in JavaScript.
1 reply
0 recast
1 reaction

jake pfp
jake
@jklb.eth
haha I hear the concern, but modifying/watching these variables isn't my use case. I'm working on a tailwind plugin that assigns a bunch of css vars from a user config - and I'd like hook into the same infra for assigning my transition values 🤷
0 reply
0 recast
0 reaction