This doc will get you up and running fetching tokens from a Figma file.
The CLI allow you to create the various kinds of configurations that you will need for interacting with Figma. Handoff has sane configuration defaults but the various kinds of configurations can be tailored or extended.
Handoff has a number of ways you can configure the output -
handoff.config.json | General handoff configuration. |
pages | Markdown files that will create or customize pages in the documentation app |
exportables | JSON schemas for each component in your figma file that you want to pull into handoff. |
integration | SASS mappings and html templates for making it easy to map handoff tokens to your frontend framework. |
The CLI exposes two ways to manage the config - make
and eject
.
Eject commands will take the default configuration and eject them into the current working directory. If you customize these configurations, then run handoff commands in that directory, these configs will be executed.
1make:page <component> <state> [opts] # Creates a new page 2handoff-app make:page button components # This will create a new markdown page called button.md, in the components section. 3 4make:exportable <type> <name> [opts] - # This will create a new schema. This is deprecated in favor of the plugin 5 6make:template <component> <state> [opts] # Creates a new template 7
Make commands will generate a boilerplate configuration in the current working directory. This is useful for extending handoff for different components or integrations.
1make:page <component> <state> [opts] # Creates a new page 2handoff-app make:page button components # This will create a new markdown page called button.md, in the components section. 3 4make:exportable <type> <name> [opts] - # This will create a new schema. This is deprecated in favor of the plugin 5 6make:template <component> <state> [opts] # Creates a new template 7