/Sketch-Constraints

A plugin that integrates constraints in Sketch to lay out layers.

Primary LanguageJavaScriptMIT LicenseMIT

Sketch Constraints

Banner Sketch Constraints is a plugin that integrates constraints in Sketch to lay out layers. These constraints are relative to the parent, either a group or an artboard, and they are linked to layer names, so every layer with the same name will have the same constraints applied to it.

Usage

Edit Constraints ⌘ + E

Edit Constraints example

Update Layout ⌘ + L

Update Layout example

Example

iOS 9 Lockscreen example Watch on Vimeo

Installation

Make sure you have the latest version of Sketch 3 installed. (Sketch 3.3+)

  1. Download the ZIP file of this repository
  2. Double click on Sketch Constraints.sketchplugin

Notes

  • Constraints are not relative to other layers, only to the parent.
  • Update Layout updates every artboard of the current page.
  • When a group is resized, all the children layers are resized. If you want a child layer to keep its size, check Width and/or Height.
  • Currently, constraints are linked to layer names. Linking them to layer IDs wasn't a better solution because it would stop working for duplicated artboards and layers. If you know how to improve this, ping me on Twitter or create an issue.

Inspiration

License

Sketch Constraints is released under the MIT license. See LICENSE for details.