Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic sections #43

Closed
leinerud opened this issue Nov 10, 2015 · 4 comments
Closed

Dynamic sections #43

leinerud opened this issue Nov 10, 2015 · 4 comments

Comments

@leinerud
Copy link

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:

  • A section consists of a unlimited number of other elements (just like a group)
  • A section is dynamic in height, so if the height of the section is changed, it pushes the sections below down.
  • Each section can be dragged and dropped over/under other sections to sort them from page top to bottom.
@matt-curtis
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

  • using 100% in the top and bottom pinnings equals 100% of previous sibling's height and
  • using 100% in the right and left pinnings equals 100% of the previous siblings width.

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

@leinerud
Copy link
Author

Oh yeah. So great! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants