DEV Community

Cover image for Sketch Units Plugin 2.0.0-rc.1 available
Dennis Ploeger
Dennis Ploeger

Posted on

1

Sketch Units Plugin 2.0.0-rc.1 available

In case you didn't know, Sketch is an awesome vector,pixel, umm... "vecxel" design application for macOS. You can use it to design mockups, icons, screens and far more.

Sketch can be extended using plugins written in Javascript with a quite ugly mix of Cocoa baked in (made possible by Mocha and CocoaScript).

Some days ago I wrote a plugin for converting the pixels, that Sketch uses as a base unit to various real life units by using a DPI value and a factor. So when you export something in Sketch as a PDF, it will be exported with an DPI value of 72. Based on that you can very simply convert the pixel unit to every unit you want.

However, version 1.0 of the plugin wasn't quite well designed and the developer tools available at that time were very basic.

Also, version 1.0 used CocoaScript for the dialog UIs and that was a real pain.

Nowadays, skpm is available, a nice tool to build up the development environment for a Sketch unit. Additionally, one came up with a library that uses WKWebview for rendering sketch UIs in a browser window. This way I could simply wrap up a Bootstrap UI and some JQuery magic to build up my dialogs.

So, announcing version 2.0.0-rc.1 of the plugin. If you're using Sketch or if you're interested in how to write Sketch plugins, you might want to check it out.

Cover photo by Crispin Semmens

Top comments (0)

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay