Variant modes disabled and I don't know why

Recreation of bug:
My button consists of 2 icons and a text layer, those can be toggled between light and dark mode

When I select their parent container which has auto-layout I no longer have the option to switch to dark mode

And I don’t understand why I can’t apply the dark mode or what going wrong.

So as a user who wants to apply modes to my layers, I can’t understand why modes cannot be applied and I wish I had some sort of information tooltip that would tell me what’s wrong.

From what I understand if you set the mode on an inner layer (child), outer layers (parents) won’t be able to override that mode so it doesn’t make sense to apply a mode there. You should be setting the mode to the outmost layer (< Button />) instead of the layers inside it, as they will naturally inherit the same mode as their parent.

Nope. It’s the same story as with the second screenshot i posted.

I managed to find the bug actually.
The problem was that auto layout hat also the new variable “number”. So for mode switching to work auto layout must not have any variables
image

If you replace the variables with a regular value the problem will be gone somehow.

There’s a note here about this: https://help.figma.com/hc/en-us/articles/15343816063383-Modes-for-variables#Switch_modes_on_a_page

I’m not entirely clear on what they’re saying, but if you have libraries updated and are not referencing disabled variables, then it should work.

In my case, modes were disabled because I had some components inside the frame which were part of another library. I first applied the variable modes to this library and then updated the components in the file where I was using them, this resolved the issue.

Variables > Library > My file

In my case, I have disabled modes in my file, although I deleted everything and no library is activated. How can I get rid of obviously unused modes? Can anybondy help? @Figma_Support perhaps?

I have the same situation. Everything works well in almost of files. Except the one with problems. Even if I duplicate it, the bug keeps existing in the copy.

Figma support wrote to me about this in response to a direct enquiry:

From what I can see this is all currently expected while the engineers work to clear some remaining bugs with the mode switcher and tackle some difficult problems around deleted modes.
To clarify why this is happening I think it’s helpful to know about the ‘Internal canvas’ that all Figma files contain. This space in the file stores a local copy of all components, styles and variables used in the file, so that updates can be held until accepted. You’ll see this space noted in your ‘Resource use’ panel, available under the View menu, and there are specific circumstances where we’ll ‘garbage collect’ from that space or leave potentially in-use deleted components, styles or variants stored there.
For example, if a variant is applied to a frame on the canvas, and then unpublished, it will remain stored on the internal canvas because it’s still in use. You would expect to see this mode shown in the switcher for that frame, but not in a new frame, which is what’s occurring now as you note. We’d agree this is not expected and are working towards a solution, both for making this switcher more relevant/accurate and for helping you remove deleted or unpublished variables from your file. Though, as I noted in my initial reply this will take some time.

With “Resource use” panel, they mean the now called “Memory usage” panel.

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