Code Monkey home page Code Monkey logo

dynamic-reposition's Introduction

Dynamic Reposition

Make it easy to resize an object without having to manually move all the content to keep the margins

How to img

##How to install it

First of all you need to have Sketch 3 installed.

###Use Sketch Toolbox (recommended) Use Sketch Toolbox to search for Dynamic Reposition and click install.

###Install manually

  1. Download the latest release and open it
  2. Navigate the Sketch menu bar to Plugins ▸ Reveal Plugins Folder
  3. Place the directory into the revealed plugins directory

##How to use the plugin

  1. Select a layer you want to use as an background and rename it to "background".
  2. Give all the other layers/groups inside of the same group margin properties (see below).
  3. Select the main group.
  4. Use the plugin by pressing cmd p or select plugins ▸ 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.

###Set properties

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: or top:
  • right r: or right:
  • bottom b: or bottom:
  • left l: or left:

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

Make sure to seperate each property with a semicolon :

License

Dynamic Reposition is released under the MIT license. See LICENSE for details.

dynamic-reposition's People

Contributors

antonstrand avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.