Skip to content

v0.5.4 — Figma Extraction Upgrade

Choose a tag to compare

@zk-xyz zk-xyz released this 15 Apr 03:53

From dogfooding brand_extract_figma against the C5 brand file.

Problem Found

The Figma MCP's get_variable_defs returns a simple { name: hex } map, but our tool only accepted structured { name, resolvedType, value } arrays. Also, get_design_context returns code with embedded colors that aren't Figma variables (e.g., raw bg fills). The old tool missed these entirely.

Fixed

  • New variable_map param: accepts the simple { "C5 Orange": "#f44d37" } format directly from get_variable_defs
  • New design_context param: accepts raw get_design_context output and automatically parses colors from CSS var() fallbacks, bg-[#hex] classes, and HEX: XXXXXX text labels
  • New figma_url param: accepts full Figma URLs and auto-extracts the file key
  • Better role inference: color names like "C5 Orange" map to primary, "Dark Grey" to text, "White" to surface, "Acid Green" and "Light Pink" to accent
  • Design context font parsing: extracts font families and sizes from generated Tailwind code

Result

C5 brand file extraction: 4 colors from variables + 2 additional from design context = 6 total (previously would have been 0 without the right input format).