This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Benedikt D Valdez Stefánsson
Posted Mar 01 - Read on Facebook

Hey there - trying out 'states', but having problems with changing certain properties, more specifically fontSize - I've tried setting it as fontSize directly, and as style.fontSize (like in the current code snippet below) - but although the background color change is applying, the font-size stays the same.

Are there limitations to which properties can be modified by states?

code =
demo project =


Joey Lamelas

I'm not sure you can animate styles. Try using the layer's scale property.

Benedikt D Valdez Stefánsson

Hmm - Fair enough, but wouldn't it be a more logical fall-back to actually change the property, regardless of animations? Seeing that would tell me as a user that "oh ok, framer can't animate this" - but the state has been changed so it should "change" :)

Jordan Robert Dobson

You can listen to events on state change. Then do a swap at that point.

Benedikt D Valdez Stefánsson

Yeah I did something similar to that as a work around.. What I meant in my comment though is that the fall-back when trying to animate properties that can't be animated should rather be to apply the new value (without animation) instead of just doing nothing at all - tells me as a developer a lot more, instead of thinking it might be a bug or something wrong in my code, my first thought would be "oh ok, framer can't animate this"

Just a thought :)

Jordan Robert Dobson

I think it's an issue with the type of value. I'm pretty sure it only animates numeric values that are animatable. So that's why you don't get it.

Jordan Robert Dobson

You change the font size using the style property.

Read the entire post on Facebook