0.0.17 • Published 3 years ago

@icona79/sketch-plugin-utilities v0.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
3 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

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago