All Projects → DWilliames → Paddy Sketch Plugin

DWilliames / Paddy Sketch Plugin

Licence: mit
Automated padding, spacing and alignment for your Sketch layers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Paddy Sketch Plugin

Sync.sketchplugin
Keep your design team in sync!
Stars: ✭ 357 (-83.91%)
Mutual labels:  sketchapp, sketch-plugin, sketch, design-tools
Html Sketchapp Cli
Quickly generate Sketch libraries from HTML documents and living style guides, powered by html-sketchapp
Stars: ✭ 631 (-71.56%)
Mutual labels:  sketchapp, sketch-plugin, sketch, design-tools
Data Populator
A plugin for Sketch and Adobe XD to populate your design mockups with meaningful data. Goodbye Lorem Ipsum. Hello JSON.
Stars: ✭ 1,665 (-24.97%)
Mutual labels:  sketchapp, sketch, design-tools
Chromatic Sketch
Sketch plugin for creating good-looking and perceptually uniform gradients and color scales.
Stars: ✭ 445 (-79.95%)
Mutual labels:  sketch-plugin, sketch, design-tools
Sketch Find And Replace
Sketch plugin to do a find and replace on text within layers
Stars: ✭ 693 (-68.77%)
Mutual labels:  sketchapp, sketch-plugin, sketch
Sketch Batch Create Symbols
A plugin for Sketch to convert selected layers to individual symbols.
Stars: ✭ 134 (-93.96%)
Mutual labels:  sketchapp, sketch-plugin, sketch
Keys For Sketch
Advanced shortcut manager for Sketch app.
Stars: ✭ 281 (-87.34%)
Mutual labels:  sketchapp, sketch-plugin, sketch
sketch-plugin
Design your next Atlassian app with our component libraries and suite of Sketch tools 💎
Stars: ✭ 51 (-97.7%)
Mutual labels:  sketch, sketch-plugin, design-tools
Persiansupplier
Sketch Plugin for supplying dynamic persian data.
Stars: ✭ 46 (-97.93%)
Mutual labels:  sketchapp, sketch-plugin, sketch
6spiral Sketch Plugin
Sketch plugin to draw Spiral and Helix shapes.
Stars: ✭ 72 (-96.76%)
Mutual labels:  sketch-plugin, sketch, design-tools
Move To Library Sketchplugin
You can now move symbol from your project to any library and re-attach all the symbol instances to this library. also it keep the overrides without any problems and it work with abstract that have libraries not in your local machine
Stars: ✭ 174 (-92.16%)
Mutual labels:  sketch-plugin, sketch, design-tools
Sketch Connection Flow Arrows
Plugin for generating easy to use connection flow arrows in Sketch
Stars: ✭ 275 (-87.61%)
Mutual labels:  sketchapp, sketch-plugin, sketch
Sketchcontentsync
Sync sketch files with google docs.
Stars: ✭ 270 (-87.83%)
Mutual labels:  sketchapp, sketch-plugin, sketch
Sketch Image Compressor
A Plugin for Sketch that compresses your bitmap assets, to keep filesize to a minimum.
Stars: ✭ 338 (-84.77%)
Mutual labels:  sketchapp, sketch-plugin, sketch
nudge-resize-sketch-plugin
Sketch Plugin to quickly resize a layer with keyboard shortcuts
Stars: ✭ 25 (-98.87%)
Mutual labels:  sketch, sketch-plugin, cocoascript
Kitchen
Powerful sketch plugin for design cooperation 🍳🍳🍳
Stars: ✭ 103 (-95.36%)
Mutual labels:  sketch-plugin, sketch, design-tools
sketch-dark-mode
Generate a dark mode version of any Sketch document, the right way.
Stars: ✭ 58 (-97.39%)
Mutual labels:  sketch, sketch-plugin, sketchapp
autopdfexporter-sketch-plugin
A Sketch Plugin to auto-export all '[S]' Prefix artboards to a single pdf, no slices needed! Plugin auto creates slices from prefixed Artboards and exports them into a single page-sorted pdf file.
Stars: ✭ 16 (-99.28%)
Mutual labels:  sketch, sketch-plugin, sketchapp
Sketch Commands
A collection of script commands for Sketch.app
Stars: ✭ 826 (-62.78%)
Mutual labels:  sketchapp, sketch-plugin, sketch
Notes
A sketch plugin for taking notes
Stars: ✭ 87 (-96.08%)
Mutual labels:  sketchapp, sketch-plugin, sketch

⚠️ This project is no longer actively maintained

Whilst some of the functinality may continue to work on versions earlier than Sketch v53; I am no longer spending my time actively working on this project. Thanks for all the support of those that have been using Paddy!

For a deeper understanding of why I have stopped working on it; find out more here.

It seems that the Sketch team are looking into building this functionality natively 🎉; in the meantime, Anima have released an update that has a lot of the same functionality as Paddy 2; check it out here.

This code is open source, so please feel free to fork it and do whatever you want with it 👌


Paddy sketch plugin – automated padding and spacing for your Sketch layers

Using Paddy

Double click the downloaded file (Paddy.sketchplugin) to install it.


If you are using this plugin, please 'star' this project. It's a simple way for me to be able to see how many people are using this, and how much effort I need to put into improving it further.

If you love this plugin, why not shout me a coffee ☕️ via PayPal to share the love! It will definitely help me to be able to support this plugin further.

Follow @davidwilliames on Twitter Twitter Follow


Go to 'Layer padding' Go to 'Automatically applied' Go to 'Symbol support' Go to 'Spacing & distribution' Go to 'Auto alignment'

📖 View change log / release notes


Why this plugin?

There are some similar plugins out there that do some of the features of this plugin, but none of them do all of it in the simple way I wanted them to.

  • Automatic: Most other plugins require a keyboard shortcut for them to be applied, or re-applied. This is all done automatically as you manipulate your layers; simply deselect everything, and will be updated.
  • Visible properties: It's easy to scan your layer list to see what padding / spacing is applied to your layers and groups; without the need to select them individually. This is because all the properties are set via the layer's name.
  • No special data manipulation: This simply resizes and moves your layers to optimal positions – it doesn't turn your groups into a special 'Stack group' or something; so other people or programs such as Zeplin, can read the Sketch file perfectly fine, without the need for this plugin too.
  • Lightweight: It just does a couple of core things – it's not bloated with a bunch of unused features.

Layer padding

Padding can be applied to one 'Background' layer (either a shape layer or a Symbol) of a group. The 'Background' layer will automatically resize itself so that it surrounds all other layers within that group by a specified amount.

Specify the padding amount within the background layer's name between '[' and ']'. e.g. Background [10 20]. The format of the padding values should be in the same order as CSS.

Examples:

  • [20]
    • all sides have a padding of 20
  • [10 5]
    • top and bottom padding are 10
    • left and right padding are 5
  • [10 5 15]
    • top padding is 10
    • right and left padding are 5
    • bottom padding is 15
  • [10 5 15 20]
    • top padding is 10
    • right padding is 5
    • bottom padding is 15
    • left padding is 20

Run the plugin command 'Enter padding for selection' or Control + Alt + p to bring up an input field, to save padding to all your selected layers easier.

If you don't want to be prompted to enter the specified padding, and instead want it to be automatically inferred from what it already is – run the command 'Imply padding for selection' or Command + shift + p.

Padding example

Ignoring specific layers

To ignore specific layers when the Background layer is calculating it's size based on the padding. Simply prefix the name of the layer you want to ignore with a '-'. e.g. -new badge would be ignored.

Padding example ignoring layer

Ignoring padding for specific edges

If you don't want to apply padding to the top, bottom, left or right; simply use an 'x' instead of a number.

E.g to set padding of 60 to the top and bottom, but ignore applying any padding on the left and right, the background layer's name would include [60 x]

Padding example ignoring width

More advanced sizing expressions

You can also specific maximum and minimum sizes alongside padding values, separated by a semi colon – ';'. e.g. [20 10; width <= 50] would apply a max width of '50'.

  • For width use: width or w
  • For height use: height or h
  • Available operators: >=, >, <, <=, =

Example: [20;h>=250] would apply padding of '20' in all directions, with a minimum height of '250'. Padding example with minimum height


Automatically applied

In order to resize the background layer to the specified padding, simply deselect all layers – or press esc on your keyboard to deselect layers automatically.

This will automatically update all paddings and spacing for the previously selected layers.


Symbol support

A lot of time and effort has gone into making sure Paddy works with symbols as well. If a symbol contains a background layer with padding; the symbol instance will automatically resize so that the background layer has enough padding around its sibling layers.

Padding example resizing symbols

This works great for creating dynamically resizing buttons.

Padding example resizing symbols

This should work with Sketch Libraries too! (At least it seems to in my limited testing – fingers-crossed 🤞)

This does not manipulate elements within a symbol, it simply resizes the symbol to the best size to fit. Because of this, each symbol cannot contain more than one 'Background layer' with padding.

For best results, avoid applying padding in deeply nested groups within the symbol.


Spacing & distribution

Similar to Anima's Stacked layers or the Distributer plugin, you can also apply 'spacing' to any group, for it to automatically distribute all its children.

To set the spacing / distribution of the layers in a group, add the spacing properties within a [ and ]; similar to applying padding to a group.

Properties: [{Spacing}{direction}]

  • Spacing: the amount of spacing e.g. '10', '4'
  • Direction:
    • 'h' for horizontal
    • 'v' for vertical

Spacing / distribution examples

  • [10v] – spacing the elements vertically, with a spacing of 10
  • [5h] – spacing the elements horizontally, with a spacing of 5

Run the plugin command 'Apply spacing to selection' or Control + Alt + Command + p to bring up an input field, to save spacing to all your selected groups easier.

Spacing example

Spacing in symbols

Let's talk about spacing in symbols. You can layout your elements with 'spacing' within your Master symbol artboard, if that makes things easier... however, it will not maintain the spacing after overriding the symbol. This is simply not possible without doing some weird data manipulation, which would break viewing it in other programs such as Zeplin.

If however, you do not care about being compatible with programs such as Zeplin; you can you Anima's AutoLayout plugin with 'Stack groups'. Paddy will take Stack groups into account when resizing a symbol; even with its overrides. Which in most cases, is probably what you want to do when applying spacing within your Symbol.


Auto alignment

You can also set the alignment for all the layers within a group — all of which will be automatically applied. 'Alignment' can be applied on a group by itself, or in conjunction with 'spacing'.

Similar to spacing / padding, it is by naming the group something specific, within [ and ].

Properties: [{alignment}] or [{Spacing}{direction} {alignment}]

Alignment

  • 'l' / 'left' – align to the left
  • 'c' / 'center' – align in the center, horizontally
  • 'r' / 'right' – align to the right
  • 't' / 'top' – align on the top
  • 'm' / 'middle' – align in the middler, vertically
  • 'b' / 'bottom' – align on the bottom

Alignment example

Examples

  • [left] – align all layers left
  • [10v c] – space all layers vertically with a spacing of 10, all centered horizontally
  • [5h b] – space all layers horizontally with a spacing of 5, all aligned at the bottom

Alignment with spacing example

You can even specify more than one alignment value, if you wish. For example: [c m] will align the layers in the middle and center. Or [t c] to align on the top + center.


Contribute and report bugs

This plugin is in active development.

Pull requests are welcome and please submit bugs 🐛.

Contact

Twitter Follow


Check out my other Sketch Plugins:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].