Parse Figma’s file

To get Figma’s object tree we will use this simple async fetch script:

This script will get to us the following structure in the console:

What we are looking for here is styles subobject it contains all styles used in the document.

But, unfortunately, Figma doesn’t provide values inside each style only type and name.

So, we will act differently, we will parse page and artboards inside the file. Here is our UI Kit structure: