0.0.17 • Published 4 years ago

@icona79/sketch-plugin-utilities v0.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Sketch plugin utilities

Useful functions for Sketch plugins. Provides functions to be reused into your plugins.

Installation

npm i @icona79/sketch-plugin-utilities

Usage

You can import all the functions in once via

var SketchUtilities = require("@icona79/sketch-plugin-utilities");

or select every single function you need:

import { functionNameA, functionNameB } from "@icona79/sketch-plugin-utilities";

Smart Layout options

Set Constraint (Pinning properties)

Set the Pinning Properties and Size properties for the selected artefact

import { setResizingConstraint } from "@icona79/sketch-plugin-utilities";

// set fix size both horizontally and vertically
setResizingConstraint(myItem, [false, false, false, false], [true, true]);
// set all the pinning properties to automatically resize the item based on its container size
setResizingConstraint(myItem, [true, true, true, true], [false, false]);

Note: in case of all the same direction parameters are true (which will cause a Sketch error) the pin properties wins over the size contraint properties

Set Smart Layout

Set the Smart Layout properties for the selected artefact (Symbol or Group only)

import { setSmartLayout } from "@icona79/sketch-plugin-utilities";

// set the item's smart layout to be resized horzontally from the center
setSmartLayout(myItem, "HorizontallyCenter"));
0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago