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

What is Framer? Join the Community
Return to index
Irfan Mir
Posted Jan 27 - Read on Facebook

Hello guys,

I'm a long-time js dev and I'm interested in using Framer for rapid prototyping.

I have a few questions before I purchase based on my usage of the trial:

How can I change the background's colour to white instead of black?

Does my prototype have to be rendered in the iPhone to the right?

How can I make a layer have fluid dimensions, I've done .width = '100%' but that doesn't work. Is there a way I can do this?

One last thing, how can I add box-shadows to layers?

Thank you very much!

12 Comments

Andreas Wahlström

1. bg = new BackgroundLayer backgroundColor: "white"
2. You can change the frame by clicking on the "Viewer" button in the toolbar.
3. layer.style.width = "100%"
4. layer.style.boxShadow = "1px 1px 1px white"

keep in mind that the framer library is free and open source. It's only the editor that costs. More info: https://github.com/koenbok/Framer

Irfan Mir

Thank you very much!

Irfan Mir

Actually, one thing, I'm trying to set the width and it is sticking to the default width on this new layer.

Here the code: l1.style.width = '80%'

Irfan Mir

and the error i'm getting stays layer.width can't be set to string

Andreas Wahlström

weird. "layer.width" can't be set to string, but if you use style.width, it should work. full code example:
b = new Layer
b.style.width = "100%"

Irfan Mir

I am doing .style.width and the layer is remaining the original default square dimensions

Peter Hilgersom

bg = new BackgroundLayer({height:1136, width: 640, backgroundColor:"white"}) works for me so far :- )

Peter Hilgersom

Whoops Andreas Wahlström beat me to it

Irfan Mir

I was able to change the background layer. But now, i'm talking about a normal layer. I want it to have a percentage width. But when I change it, it doesn't change to the percentage width.

Andreas Wahlström

Can you sure the full code? Might be easier to understand, that way. There's a share button inside framer studio nowadays.

Irfan Mir

http://share.framerjs.com/xbo7twqq3rxp/

See, it is not 80% of its parent.

Andreas Wahlström

oh. that's because of .center(). It basically uses layer.width to center itself and therefore override the style.width property. here's one way to get around that: http://share.framerjs.com/8qkl089862c8/

Read the entire post on Facebook