Skip to main content
Ashutosh Verma
New Member
Jan 15, 2025 8:40 AM UTC
Solved

Extracting mode name from figma API

Hello,

I am currently developing a Figma plugin to extract local variables. However, I am facing difficulty in extracting the mode name (which I intend to use for segregating variables based on different modes, such as dark mode and light mode). Could you please advise if there is a method to retrieve the mode name?

This topic has been closed for replies.
tank666
tank666Solution
Jan 15, 2025 9:45 AM UTC

Get the VariableCollection object that stores the variables you need and check the value of the modes property.

VariableCollection.modes[i].name

 

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank

1 reply

tank666
tank666Solution
Jan 15, 2025 9:45 AM UTC

Get the VariableCollection object that stores the variables you need and check the value of the modes property.

VariableCollection.modes[i].name

 

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank