Make it easy to resize an object without having to manually move all the content to keep the margins
First of all you need to have Sketch 3 installed.
Use Sketch Toolbox to search for Dynamic Reposition
and click install.
- Download the latest release and open it
- Navigate the Sketch menu bar to
Plugins ▸ Reveal Plugins Folder
- Place the directory into the revealed plugins directory
- Select a layer you want to use as an background and rename it to "background".
- Give all the other layers/groups inside of the same group margin properties (see below).
- Select the main group.
- Use the plugin by pressing
cmd p
or selectplugins ▸ Dynamic reposition
The shortcut can easily be changed by changing the first row in the plugin
You'll need a background. You can either create a layer or a group called "background" or it will take the largest layer in the group and use it as the background.
You set the margin in the name of the layer. For instance, My button t:10:l:50
will position the button top: 10px
and left: 50px
.
You can set properties for:
- top
t:
ortop:
- right
r:
orright:
- bottom
b:
orbottom:
- left
l:
orleft:
By not setting any properties for top
or bottom
it will be placed in the middle of the background. If you don't set any properties for left
and right
it will be centered.
By setting properties for both top
and bottom
or/and left
and right
the object will be stretched out to keep the right distance to the background. Make sure to not have locked proportions otherwise it wont work as it is supposed to. To have more control over resizing objects make sure to try out my other plugin, Sketch Resize
You can set size properties for:
- width
w:
orwidth:
- height
h:
orheight:
- fontSize
fs:
orfontSize:
Make sure to seperate each property with a semicolon :
Dynamic Reposition is released under the MIT license. See LICENSE for details.