design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Generate sketch file from Storybook

Open domyen opened this issue 6 years ago • 6 comments

Looking for contributors to help us explore this uncharted territory.

Goal Generate Sketch (or other design files) from the production components and stories. This helps designers stay in sync with the bonafide UI instead of toying with UI facsimile.

TODOs

  • Integrate a tool like HTML sketchapp or Sketch constructor (by Amazon)
  • Explore the workflow for generating file on CI build
  • Explore workflow of how a designer consumes the design system

domyen avatar Aug 06 '19 16:08 domyen

I've spent a little bit of time looking into this. It's definitely possible, but I will say there's gonna be some hurdles. Specifically:

Explore workflow of how a designer consumes the design system

When getting my hands dirty making a Sketch component library, I learned about best practices for Sketch symbols and creating nested symbols. I'm wondering how we could auto-gen a Sketch symbol idiomatically.

Consider a <Checkbox /> component. In the Sketch symbol, you could have a layer style for checked/unchecked, with the ability to pass a label for the text to display beside it. If you're properly using nested symbols, you can change from unchecked -> checked without losing your label value. If the checked state is an entirely new symbol, then you lose that value.

Maybe the pros from auto-generating outweigh this con. It's also possible we could add attributes into the CSF to pass metadata to Sketch somehow.

leerob avatar Aug 08 '19 13:08 leerob

To share the generated sketch lib, would it be possible to push that to sketch cloud ? The designers in my company share their sketch components lib through this service, I don’t know if they have a rest api for that

jsomsanith avatar Aug 08 '19 15:08 jsomsanith

@jsomsanith That would be nice. Doing some quick searching, I don't see anything about a Cloud Rest API.

Some other things I've looked into:

leerob avatar Aug 08 '19 15:08 leerob

👀 https://github.com/react-figma/react-figma

leerob avatar Sep 16 '19 20:09 leerob

@jsomsanith maybe having the ability to update existing files is enough. That way, someone in your team can have the local files updated and then sync them manually with Sketch cloud. From what I remember, Sketch Cloud already works like that.

Sketch constructor seems to have the ability to manipulate an existing Sketch file, so it seems doable.

damcalder avatar Oct 25 '19 15:10 damcalder

Yeah, the ideal target would have been to automate that. But it doesn’t seem possible. Manual sync is a good suggestion

jsomsanith avatar Oct 28 '19 07:10 jsomsanith