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

What is Framer? Join the Community
Return to index
Anton Jarl
Posted Jun 17 - Read on Facebook

I'm having problem with the layer.index. I won't get it to work correctly. I have 3 imported Sketch layers and I want to put my Framer layer in between those but it won't work. Should it be possible to just add a layer index to ANY layer?


Balraj Chana

Can you upload a screenshot of your layers list in Sketch? It depends on how you set up your groups.

If your groups in Sketch are not nested i.e. no superLayer, then you can simply change the index of the Framer layer to go behind or in front of your Sketch layers.

If the groups are nested i.e. a superLayer exists, then the Framer layer should have the same superLayer as the Sketch layers. Then you can adjust the index from there:

Anton Jarl

This is how it looks in Sketch. No superLayers. But i still do not get it to work. The Framer layer ends up either in front of all the Sketch layers, or behind all of them. Can't get it to go in between...

Balraj Chana

When you use an artboard in Sketch, it's converted into a superLayer as soon you import it into Framer. You can either remove the artboard or assign the superlayer for the Framer layer to the MenuArtboard. This should work now:

# sketch = Framer.Importer.load "imported/fileName"
artboard = sketch.MenuArtboard

layer = new Layer
superLayer: artboard
index: 1

Anton Jarl

Ahh, cool. Didn't see that in any documentation. Thanks Balraj Chana!

Anton Jarl

Worked brilliantly!

Balraj Chana

You're welcome :)

Read the entire post on Facebook