Skip to main content
Solved

Changing variable mode for layer


Sajid

I’m working on a Figma plugin to create color swatches dynamically based on local variable collections. The generated color swatches would be binded with the variables.
While I’ve managed to generate seperate frame for swatches of the both modes (Mode 0 ) (Mode 1 ).

The issue is for Mode 1 Frame I’ve to change variable mode because by default it’s set to Auto (which is Mode 0).
So is there any way to change variable mode for a layer in Figma API?

Screenshot 2023-08-21 060115

Any guidance or insights on how to achieve this would be greatly appreciated!

Best answer by tank666

node.setExplicitVariableModeForCollection(collectionId, modeId)
figma.com
View original
This topic has been closed for comments

2 replies

tank666
  • 4854 replies
  • Answer
  • August 21, 2023
node.setExplicitVariableModeForCollection(collectionId, modeId)
figma.com

  • 0 replies
  • August 24, 2023

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings