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

What is Framer? Join the Community
Return to index
Veronica Jimenez-Miller
Posted May 10 - Read on Facebook

Happy Monday Framers! What's the best way I could give shared properties to layers? My code is like this :

card_shadows = ["card_left", "card_middle", "card_right"]
card_shadows.properties =
shadowY: 10
shadowBlur: 16
shadowColor: "rgba(0,0,0,0.4)"

This is not working ;'/ Do you have any suggestions?

Thanks!!!

4 Comments

Geunbae Lee

How about using functions?

Andreas Wahlström

A for loop would be great for this. Create an array with layers, eg. [card_left,card_middle] etc. then use a for loop to set the properties of each one. Here's a great article about arrays and loops: https://medium.com/framer-prototyping/code-less-achieve-more-with-arrays-in-framer-c43594d13d59#.icv7euu5d

Trevor Phillippi

Another option is to subclass Layer and make something like ShadowLayer with default properties and make each new card as a ShadowLayer as opposed to generic Layer type.

Veronica Jimenez-Miller

Boom, thank you guys!

Read the entire post on Facebook