I’ve tested it with modes and variables in the example you’ve given and it works properly.
But i’m not quite sure what you mean.
Hey @Raphael_M, what you showed used boolean variables, and works for that simple use case.
What about for a more complex usecase where there are more than 2 brands (and booleans only cater for two options, true and false)?
E.g. Five brands (A, B, C, D and E):
Screen
- Header
– Logo (variant = BrandA)
Screen
- Header
– Logo (variant = BrandB)
Screen
- Header
– Logo (variant = BrandC)
Screen
- Header
– Logo (variant = BrandD)
Screen
- Header
– Logo (variant = BrandE)
Perhaps the issue I am facing is that string variables cannot set variants, only boolean variables can set variants?
That is still possible.
You can even use it on prototyping
Hey @Raphael_M , here is an even simpler summary video showing the core problem:
Variables cannot set variants for instances that come from libraries.
Since you’re using regenerate all instances, that means that it is an unusual behavior. It probably has something to do with your complex nesting that involves multiple files or it doesn’t load the function for the mode upon the start of the app, so it has to be manually updated using the regenerate all instances command.
I haven’t really thought of using modes to control the variants on the wf though
Is there a way to use the API to call the Regenerate all instances method?
Be great if Figma would make regenerating all instances an option for when files load.
And if not, then to be able to call that method using the Figma Plugin API to do it
I hope i got the right answer.