matt-curtis / Fluid-for-Sketch

[Sketch Plugin] Sketch-flavored Auto Layout-like Constraints
2.38k stars 69 forks source link

Dynamic sections #43

Closed leinerud closed 9 years ago

leinerud commented 9 years ago

I would really like to be able to create "sections" to my designs which can be placed after each other (from top to bottom). Today in Sketch, if a design change is made it often results in that you have to select all other elements and "push them down" on the page.

Functionality:

matt-curtis commented 9 years ago

You can do this currently with the Previous Sibling relativity. In the next release, you'll be able to select multiple layers and edit them at once, so you can select multiple 'sections' and set constraints so that you get this stacking behavior.

I can create a demo if you'd like. Let me know if this is what you had in mind.

leinerud commented 9 years ago

Nice! But I guess that I don't understand how to use it. I have two rectangles in the same group and I set "Previous sibling" and "top:0" on the second one, but then the second rectangle places itself in the exact same position as the first, but I want the second rectangle to come directly below the first one (+ some padding). How can I do this?

And thank's for the support!

matt-curtis commented 9 years ago

You want top pinning = 100% + your padding. Percentages are relative to the dimension of the axis they're on, so:

It's the same way for Fixed Width/Height as well.

leinerud commented 9 years ago

Oh yeah. So great! Thank you.