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

Ingest style tokens from Figma file #8

Open
GLips opened this issue Feb 24, 2025 · 4 comments
Open

Ingest style tokens from Figma file #8

GLips opened this issue Feb 24, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@GLips
Copy link
Owner

GLips commented Feb 24, 2025

It would be nice to be able to ingest variables from Figma and create or update tokens—CSS variables, Tailwind configs, etc—in code. Will require a new endpoint.

@GLips GLips added the enhancement New feature or request label Feb 24, 2025
@GLips GLips moved this to Backlog in Figma MCP Server Feb 24, 2025
@Li-vien
Copy link
Contributor

Li-vien commented Feb 25, 2025

I am trying to restore the figma design more perfectly and extract the design specifications.

  1. Compress simplifiedResponse and extract common layout and style as variables.
  2. Extract vector elements that are not easy to implement in code and convert them into image nodes.
    Still learning....
{
  "name": "UI",
  "nodes": [
    {
      "id": "0:91",
      "name": "Create Video",
      "type": "TEXT",
      "textStyle": "style_P40VP0",
      "fills": "fill_HCLAPB",
      "text": "Create Video",
      "size": {
        "width": 88,
        "height": 18
      }
    }
  ],
  "globalVars": {
    "fill_HCLAPB": [
      {
        "rgba": "rgba(255, 255, 255, 1)"
      }
    ],
    "style_P40VP0": {
      "fontFamily": "Merriweather",
      "fontWeight": 700,
      "fontSize": 20,
      "lineHeight": "25.139999389648438px",
      "textAlignHorizontal": "LEFT",
      "textAlignVertical": "TOP"
    },
    "childrenToParents": {
      "vector_ACAEHB": [
        "0:96"
      ],
      "vector_BB8S9B": [
        "0:103"
      ],
      "vector_6FR6P5": [
        "I0:108;2552:17336",
        "I0:108;2552:19136",
        "I0:108;2552:19676",
        "I0:108;2552:20144",
        "I0:108;2552:20561",
        "I0:108;2552:21026",
        "I0:108;2552:21482",
        "I0:109;2552:17336",
        "I0:109;2552:17961",
        "I0:109;2552:19136",
        "I0:109;2552:19676",
        "I0:109;2552:20144",
        "I0:109;2552:20561",
        "I0:109;2552:21026",
        "I0:109;2552:21482",
        "I0:110;2552:17336",
        "I0:110;2552:17961",
        "I0:110;2552:19136",
        "I0:110;2552:19676",
        "I0:110;2552:20144",
        "I0:110;2552:20561",
        "I0:110;2552:21026",
        "I0:110;2552:21482",
        "I0:111;2552:17336",
        "I0:111;2552:17961",
        "I0:111;2552:19136",
        "I0:111;2552:19676",
        "I0:111;2552:20144",
        "I0:111;2552:20561",
        "I0:111;2552:21026",
        "I0:111;2552:21482"
      ]
    }
  }
}

@GLips
Copy link
Owner Author

GLips commented Feb 26, 2025

Neat @Li-vien—I see some of the changes you're working on in your fork. Looks promising, as long as AI agents are able to keep track of references to more global CSS values rather than in-line with the various layout elements.

@GLips
Copy link
Owner Author

GLips commented Feb 27, 2025

@Li-vien are you working on code that can be merged back into the main repo? I'd welcome contributions!

Otherwise I'll probably tackle this in the next week or so.

@Li-vien
Copy link
Contributor

Li-vien commented Feb 28, 2025

There are a lot of customized modifications in my branch, wait for me to sort it out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants