• Stars
    star
    236
  • Rank 170,480 (Top 4 %)
  • Language
  • Created almost 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Documentation for Zeplin extensions βš—οΈπŸ“š

Zeplin Logo

Zeplin Extension Documentation βš—οΈπŸ“š

Zeplin extensions are JavaScript modules that generate code snippets from various design elements. All code snippets you interact with in Zeplin are generated using extensions and they're curated at extensions.zeplin.io.

If you're interested in developing your own Zeplin extension, this documentation covers the basics of building one along with a tutorial and discusses their capabilities. Ping us at [email protected] if you have any questionsβ€”we'd love to hear what you're building!

If you just want to try out extensions and ended up here by mistake, head to extensions.zeplin.io to browse them.

What is an extension?

CSS extension

Extensions are JavaScript modules that implement various functions to generate code snippets from models.

In the example above, Zeplin invokes the layer function of the extension, passing the selected layer object as a parameter. Returned value is then displayed. Code highlighting is performed by Zeplin, extensions only communicate the preferred language.

Getting started

zem, Zeplin extension manager, is a command line tool that lets you quickly create, test and publish extensions.

If you have npm 5.2+ installed, you can run zem directly to create one:

npx zem create my-extension

Under my-extension, zem will generate the initial project structure:

my-extension
β”œβ”€β”€ README.md
β”œβ”€β”€ package.json
└── src
    └── index.js

index.js

Default entry point for the extension, a JavaScript document that exports functions, corresponding to different actions. To name a few:

  • colors: Generates snippets from Project or Styleguide colors.
  • layer: Generates snippets from the selected layer.
  • screen: Generates snippets from the screen.
  • component: Generates snippets the selected component.

See Extension documentation for all the functions and their details.

package.json

npm's package.json defines everything you, and Zeplin, need to know about an extension, along with its dependencies.

Apart from basic information like name and description, under the zeplin key, extensions can also define options.

See package.json documentation for details.

Running an extension

zem lets you run an extension in the command line, during development. You can execute functions with sample data and observe the results, without running the extension inside Zeplin.

To learn more about zem and the exec command, see documentation.

Your first extension

We've prepared a tutorial to guide you through your first Zeplin extension, dive in:

πŸŽ“ View tutorial

Models

Quickly jump to the documentation of a particular model to learn more about it.

Publishing an extension

When you're ready, zem lets you publish an extension to extensions.zeplin.io. Publishing an extension will submit it for review and you'll be notified via email once the extension is listed.

To learn more about zem and the publish command, see documentation.

Examples

Stylesheet

zeplin/stylesheet-extensions

Official stylesheet extensions used in Zeplin are open source, collected under a monorepo, generating CSS, Less, SCSS, Sass, Stylus snippets from colors, text styles and layers.

All stylesheet extensions make use of a package called zeplin-extension-style-kit that extracts CSS-like style properties from design elements. If you're building an extension that generates CSS-like snippets, like a preprocessor or a CSS-in-JS solution, zeplin-extension-style-kit should get you halfway there.

React Native

zeplin/react-native-extension

Official React Native extension used in Zeplin is open source. It's a full-fledged extension example, generating React Native JavaScript snippets from colors, text styles and layers.

Although it's an ideal candidate, currently React Native extension isn't built upon zeplin-extension-style-kitβ€”we're on it!

More Repositories

1

zeplin-sketch-plugin

Zeplin Sketch plugin πŸ’Žβš‘οΈ
150
star
2

emoji-autocomplete-sketch-plugin

Type β€œ:” followed by the first few letters to autocomplete emojis. πŸ’
Objective-C
149
star
3

connected-components-docs

Documentation for Connected Components
140
star
4

zeplin-html-to-pdf

AWS Lambda function that converts HTML pages to PDF documents
JavaScript
123
star
5

storybook-zeplin

Storybook addon to view Zeplin resources in story panel
TypeScript
115
star
6

zem

Create, test and publish Zeplin extensions with no build configuration βš—οΈπŸ¦„
JavaScript
81
star
7

fastlane-plugin-notarize

fastlane plugin to notarize a macOS app πŸ›‚
Ruby
68
star
8

react-native-extension

React Native JavaScript snippets from colors, text styles and layers βš›οΈπŸ“±
JavaScript
67
star
9

zeplin-palette

38
star
10

vscode-extension

Zeplin for Visual Studio Code πŸ”Œ
TypeScript
34
star
11

cli

Command-line interface for Zeplin
TypeScript
31
star
12

stylesheet-extensions

Zeplin stylesheet extensions monorepo βš—οΈπŸ–Œ
JavaScript
30
star
13

cli-connect-storybook-plugin

Zeplin CLI plugin to generate Storybook links for Zeplin components
JavaScript
20
star
14

zeplin-workbook

15
star
15

microsoft-teams-app

Bring all the important updates from your Zeplin workspace to the Microsoft Teams conversations.
TypeScript
15
star
16

cli-connect-react-plugin

Zeplin CLI plugin for React components
TypeScript
13
star
17

color-picker

macOS color picker that lets you select colors from the project/styleguide you have open in Zeplin
Swift
9
star
18

cli-connect-swift-plugin

Zeplin CLI plugin for Swift
TypeScript
8
star
19

zeplin-prism-extras

Language extras for Prism ✏️
JavaScript
8
star
20

zeplin-popout-extension

Zeplin Popout tool allows you to compare your code output with Zeplin screens for better design-development workflow.
JavaScript
6
star
21

javascript-sdk

Zeplin API client for JavaScript
TypeScript
6
star
22

cli-connect-angular-plugin

Zeplin CLI plugin for Angular components
TypeScript
3
star
23

community-crew-sdk-scripts

Zeplin Node SDK scripts used by Community Crew
JavaScript
3
star
24

openapi

An OpenAPI description for the Zeplin API
2
star