Home

Awesome

sketch-symbol-legend

Legend plugin for sketch app.

download me

Motivation

In some companies UX designers make an effort to align with the company's UX standard by creating Sketch symbols that are highly detailed. Some companies even have components library that the developer use and the UX designer wish to give them the most detailed design. After exporting to Zeplin, most of the data is lost.


This plugin provides indexing of Symbols in your artboard with a detailed legend.

It creates a text symbol with the Symbol's index above the Symbol and it adds the definition of the symbol as well as it's overrides if there are any below your artboard. Note that it will add an override only if it was overriden on the SymbolInstance.

Feature requests and pull requests are more than welcome :)

Shortcuts

command+shift+y - add legends to selected artboards

command+shift+d - clean up legends for selected artboards

command+shift+ctrl+y - add legends to all artboards

command+shift+ctrl+d - clean up legends for all artboards

How to use

  1. Select artboards for export
  2. cmd+shift+y - add legends for selected artboards
  3. cmd+ctrl+e - export selected artboards to zeplin
  4. cmd+shift+d - cleanup legends for selected artboards

Demo

legend demo

Installation

# clone the repo
git clone git@github.com:wix-incubator/sketch-symbol-legend.git
cd sketch-symbol-legend
# install packages, it will add the plugin to the Sketch app
npm install --no-lockfile

Logs output

npm run sketch:log

Important links:

Debugging:

Release

The following command will create a release with zipped artifact in this repository. That's why you need to generate Github access token.

You need to specify a version bump, it can be one of the following: <new-version> | major | minor | patch | premajor | preminor | prepatch | prerelease.

GITHUB_ACCESS_TOKEN=<token> SKETCH_RELEASE=<version-bump> npm run sketch:release

Create an Adapter

const adapter = ({symbolMaster, overridedValues}) => {
    // your logic
    return {
      //wsr props to show in the legend
    }
}

Example - https://github.com/wix-incubator/sketch-symbol-legend/blob/add-adapter-logic/Legend.sketchplugin/Contents/Sketch/legendifyArtboard/adapters/loader.js

Note that the map key is the component name.

Notes (tips, caveats, issues)