Symbol Overrides - Padding/Margin

Will we see better auto-layout features that remove the need for spacers?

An idea I had is adding separate padding or margin override functionality to symbols. It could be very useful.

I could see it becoming a similar function to Tint or Shadow, which can be added to nested symbols or groups within a symbol. The padding/margin values could be a list of spacing tokens (something new also) which would allow you the flexibility to edit it but still align to a design system’s spacing tokens.

The symbol itself could have the Margin option, while a nested symbol could have the padding option (both even :grinning:)

I mocked up what it could look like in the overrides panel!

Thanks

Hello there :wave: That’s a really cool idea :star_struck:

You can already see some of these improvements! With the Experimental Feature Better Smart Layout Reliability (available in version 95.x) you can test how symbols now resize better without spacer elements. Check out this demo: it’s a button with icons on either side. Before this improvement, you had to add spacers so the button resized correctly when hiding one icon, but now it works without spacers :smiley:

I hope this helps

Hey. While I appreciate the updates to Sketch, my only feedback is that it is not flexible enough, especially with components with 5-10 elements and in a top-down presentation.

1 Like

I agree that while the updates in Sketch 99 Beta are great but still needs more additions to make it fully functional like applying the non spacer requirement for groups, not just symbols. Great start but still need a small bit more before I can start using Sketch as my primary tool.

Hi @Keviruchis :wave: This topic was first posted a while ago in March and since then, Smart Layout in Groups has come a long way! We’ve added many improvements and fixes based on your feedback!

Smart Layout in Groups works outside symbols, all you need to do in the latest 99 Beta is select some layers, press ⌘L and then pressing the arrow keys, H or V to set the axis and direction!

SLshortcuts

Of course, this works without spacers! If you run into any issues or have some feedback, by all means, share it with us! :raised_hands:

Jorge, I think you’ve misunderstood what we are talking about. While in your example, the space in between the circles works without spacers but what if you want to add padding to the left of the green circle or to the right of the dark blue circle. Think of the button example where there is text in the middle but with a background color. Currently in sketch we have to set a background shape and set the text on top of the shape and then group them. This creates problems in visualizing and setting things in a similar way to flexbox. Having “padding”/“margin” options for groups would facilitate web design and allow us to easily structure things for our web devs.

Hey @Keviruchis :wave: thanks for reaching out!

In my last post I was just inviting you to try Smart Layout in Groups, since you mentioned you liked the changes in Beta 99, which are mostly about Smart Layout in Groups and since we’ve added a lot of improvements, I thought it was a good starting point.

Back to your example, certainly you need to at least create a group to add layout settings, and I wanted to ask if you can share a bit more about the visualization/settings problems you currently have.

We’re aware that having padding/margin controls is a great idea and how it will help improve handoff as well.

Thanks in advance!