Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for generating symbol masters and placing instances #28

Closed
gabrielecirulli opened this issue Apr 26, 2017 · 7 comments
Closed

Comments

@gabrielecirulli
Copy link

Thanks for sharing the project. It seems like an approach that makes a lot of sense when it comes to building complex design systems.

I wanted to share a bit about my workflow and a proposal for how this project could work with symbols.

I have been building a design system that uses Sketch symbols to provide various primitives, such as buttons, fields, checkboxes, containers. The users of this system make a new copy of a file containing all the symbol masters for each project they start. They use the symbols in it to compose their layouts.

Almost all of the symbol masters have 2 versions: a normal version and a "measurement" version. The measurement version has @ appended to the symbol name and contains transparent colored rectangles that represent the margins and paddings of the symbol:

new review sketch 2017-04-26 10 am-28-46

When I saw what React Sketch.app can do, its purpose immediately made sense to me in the context of this type of work. Having a tool generate all permutations of a specific component instead of having to manually compose symbols and create their measurement versions would be a much better workflow.

I'm curious to discuss if the following ideas fit with your plans for this project:

  • Similarly to rendering Artboards, React Sketch.app should be able to render Symbol Masters.
  • With a system similar to how refs work in React, it should be possible to refer to symbol masters and place instances, e.g. <SymbolInstance master="button-active"/>
  • Being able to set the resizing method on a per-element basis within masters as a prop (e.g. stretch, resize-object, etc.) would allow to programmatically define the behaviour of such symbols

Having a "style guide" that is composed out of symbol masters that are defined programmatically has a twofold advantage: designers who are not experienced in programming can directly use the generated file and symbols in it, together with simple plugins such as Auto Layout, to build their comps manually.

Designers who also have a background in programming and need to build much more complex comps can work with the same symbol instances, whose masters are still defined directly in code, and reap the benefits of Sketch's symbols implementation.

Both groups would benefit from having a library that's very flexible, always up to date, and easy to keep free of manual mistakes.

Any thoughts?

@jemgold
Copy link
Contributor

jemgold commented Apr 26, 2017

Thanks for a great write-up :)

Yes! This is on the roadmap, I haven't had time to work on it yet though.

If anyone feels up to contributing, I'd love some help — we have support for TextStyles, and adding Symbols would be similar.

Here's an API I was considering, but it might not be perfect - essentially we want an easy way of registering and using these symbols without affecting their underlying representation 🤔
src/Widget.js

import { Widget } from 'my-component-library'
import { symbolify } from 'react-sketchapp';

export default symbolify(Widget)

src/index.js

import Widget from './Widget';
render(<Widget someOverrideProp='foo' />, context.document.currentPage())

@lukewestby
Copy link
Collaborator

hey @jongold! wayfair.com uses both react and sketch extensively and we're really excited about react-sketchapp. symbol support is something we would like so i wanted to drop a note here to let y'all know we're going to work on contributing this feature 😄

@jemgold
Copy link
Contributor

jemgold commented Apr 26, 2017

@lukewestby 🙏 🙏 🙏 🙏

lmk anything I can help with - I realize there's a lot of accrued knowledge that I haven't braindumped yet

@lukewestby
Copy link
Collaborator

lukewestby commented Apr 26, 2017

Will do! I'll ask questions here or wherever else you think would be better. I could also email you for help if y'all prefer to keep issue comment threads sparse. Thanks!

@jemgold
Copy link
Contributor

jemgold commented Jun 8, 2017

Closed by #53 — should work in 0.11.0 and higher!

@jemgold jemgold closed this as completed Jun 8, 2017
@gabrielecirulli
Copy link
Author

gabrielecirulli commented Jun 8, 2017 via email

@hanonno
Copy link

hanonno commented Jun 9, 2017

Now we're getting somewhere, nice work!

To give you a bit of insight, I would like to use this to generate our design system, these components are all symbols.

system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants