GithubHelp home page GithubHelp logo

b3nnyl / figgo Goto Github PK

View Code? Open in Web Editor NEW
303.0 8.0 16.0 1.38 MB

πŸ‘―β€β™€οΈA cli tool makes your Figma and local design token stay in sync πŸ‘―β€β™‚οΈ

Home Page: https://github.com/B3nnyL/figgo

License: MIT License

TypeScript 86.44% JavaScript 13.56%
ui figma cli design-system

figgo's Introduction

Figgo

A CLI tool make your design tokens always stay up to date with your Figma design styleguide

img

img

Install Figgo

npm i figgo -g

Figma Guide

  • Create three frames named as Typography, Palette and Space in your figma file.
  • Spread out your typography, color and spacing examples to the frames. Follow this figma example for the best outcomes.
  • Grab the figma file's id.
  • Generate your personal token at account setting and grab it.

Terminal Guide

Assume you have already installed Figgo...

Global setup

  • Run figgo --init, answer a few setup questions where you will leave file id and personal token with Figgo. All configuration will save to ~/.figgo. Note: output directory needs to be absolute path.
  • Tied your belt and type figgo --sync, let tokens store in the location you wish.
  • You may run figgo --sync board_name to update tokens selectively.

Local setup

  • Create figgo.json file under your project directory.
{
  "boards": [
    {
      "boardName": "your board name",
      "id": "figma id",
      "outputDir": "output directory (this can be a path relative to your project)",
      "outputFormat": "js or scss",
      "token": "your figma personal token"
    },
    {
      ...
    }
  ]
}
  • Run figgo --sync and all tokens will store in the path you wish or update selectively via appending board name.

Basic CLI Usage

How to use
    $ figgo [<options> ...]
    Options
      --init, -i         Setup figma board and store configurations to global config files
      --sync, -s         Sync tokens based on (global/local) config files
      --edit, -e         Edit board information (not ready yet)
      --list, -l         List boards from global config files
      --remove, -r       Remove board from global config files
      --help, -h         Show help message
      --version, -v      Show installed version
    Examples
      $ figgo --init
      $ figgo --init board_name board_id output_absolute_path output_format(js|scss) figma_token
      $ figgo --edit board_name (not ready yet)
      $ figgo --list
      $ figgo --sync
      $ figgo --sync board_name
      $ figgo --remove board_name
      $ figgo --help
      $ figgo --version

Sync Token

url

Manual configuration

Edit setup configuration from config.js in ~/.figgo folder. You can also manually add Figma board through editting this file.

Dev Guide

  • Installation yarn install
  • development yarn start [options]
  • test yarn test
  • build yarn build

Changelogs

  • 0.1.1 πŸš€ Alive

  • 0.1.2 ✍️ Readme

  • 0.1.3 πŸ›  Fix minor issues

  • 0.1.5 🀠 Better UX

  • 0.1.8 🀠 Project figgo.json is supported

  • 0.1.11 🀠Fix minor issues and improve UX

  • 0.2 🧩Support css variable, fixed test and CI

TODOs

  • CLI listing board information
  • CLI specify board sync
  • js output supports
  • css variable support
  • Edit Figma board info from CLI
  • Well-formatted and styled output in terminal
  • More screenshots and documentation

License

MIT

Credits

Figma

figgo's People

Contributors

4aficiona2 avatar b3nnyl avatar dependabot[bot] avatar mot0laura avatar sergioalen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

figgo's Issues

Output format CSS

Great tool! Do you plan by any chance a plain CSS output with custom properties (CSS variables)?

Install doesn't work

I installed and reinstalled node 2 times, running node version 12.13.0

❯ npm i figgo -g
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/figgo/dist/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/figgo/dist/cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mariusnedelcu/.npm/_logs/2019-10-31T09_22_33_609Z-debug.log

Can anyone please tell me what is going on here ?

is this related to the plugin or to my environment ?

Figgo crashed if there no typography or color blocks

I trying load default color palette, but the Figgo fails because of there no any typography style.
A similar error happens when no colors styles on the page.

image

The error cause on these lines

const colorBlocks = colorFrame[0].children.filter(

const spaceBlocks = spaceFrame[0].children.filter(

TypeError: Cannot read property 'children' of undefined
    at Object.<anonymous> (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:151:45)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
TypeError: Cannot read property 'children' of undefined
    at Object.<anonymous> (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:85:47)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
TypeError: Cannot read property 'children' of undefined
    at Object.<anonymous> (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:118:47)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

Different Hex Color Output

My hex color output seems to be different from the one in Figma.

SCSS File = #ec5858;
Figma = #EB5757

test1

test

Better font family token

_front_family: 'result' => _font_family = 'result,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.