Extract styles from component variants

Hi there!

I am extracting elements and styles from the Figma file, and now I have come to implementing variants and states (might be related to topic: Get VariantProperties for Component)

Plugins in Figma do this quite easily, as they list style overrides which is accessible by the plugin api:

I cannot see this information in the Figma file itself. I can link the base component to the variant by partitioning the ID, I have yet to find a way to extract the style name of the variant.

I am extracting the style of the base component by referencing the global .styles from the Figma file:

This is referenced in the base component through the styles object. However, the styles object is not accessible from the nodes in the Figma file, is there any other way to link these together?

The plugins are able to list a backgroundStyleId and strokeStyleId in variants, but this does not seem to be available from REST?

(Any reason I can`t embed screenshots?)

Thank you for any input!

Might as well close this topic, judging by the number of similar topics with no replies.

I haven’t fully understood your question but maybe you need to do something like this:

Get components → get file → find component in the file and read its properties