Skip to main content
Solved

How to clear “Used variables” that don’t exist in the file anymore?


Show first post

94 replies

Niki
  • New Participant
  • 16 replies
  • July 11, 2024

I have also reported it to support.


Niki
  • New Participant
  • 16 replies
  • July 12, 2024

… It gets even worse if you’ve deleted a variable mode. If there are still deleted but attached variables in your file or library, then you also have to struggle with mode conflicts. In my case: I deleted a theming mode. After that I deleted a sizing variable collection (numbers). Since I’m not able to detach all deleted sizing variables – and these are applied to a lot of auto layout frames – I’m still seeing this kind of mode conflicts.

image

My workaround is now to check every component and replacing the deleted sizing variable placeholder with a raw value. Hopefully there will be an update in the near future.


Nouela
  • New Participant
  • 18 replies
  • July 12, 2024

FYI to folks combing through this massive thread looking for a solution: one does not exist. Ghost variables 4evah.


Josh22
  • New Participant
  • 9 replies
  • July 12, 2024

This is ridiculous. I can’t delete ghost variables from another file. The fact that I can apply a non-existing variable theme on a frame and it applies the styling changes to child components, despite zero connections between the 2 files, is a bug. It’s been a bug for a year, it needs to be resolved.

Example, I copy a component from one file to another. I remove all variables and references from the other file inside the component. The variable theme still shows up (e.g. light and dark mode). I can apply this theme to any frame despite it not being in the component I added.

EDIT: I found a workaround this time, to clear cache and restart the app. But, that means each component I copy over needs the ability to paste and remove variables at the same time. Otherwise every time I copy over a component requires me to clear cache and restart the app - which logs me out and resets all my preferences.


Niki
  • New Participant
  • 16 replies
  • July 20, 2024

Hi,

I reported the bug to Figma support.

They’ve replied that the variable detachment is limited to local variables in the file. They will discuss the issue and whether there is a need to extend the command to variables attached from added libraries.

So for the support it’s not a bug.

This seems a kind of odd to me. The more common case is that designers connect variables from added libraries, isn’t it? Especially when we are talking about design systems and (external) ui kits.


creative_evobi

Exact same issue. Just making sure this thread gets enough attention


Sam_Baber1

Nightmare, surely a simple fix? Needs prioritising!


  • 1 reply
  • August 13, 2024

A fix for this would be much appreciated. Bugs like this overcomplicate the design process for others involved with the project. Designers cannot pass their work on with confidence when the files aren’t clean. Any idea when we can expect a resolution?


Kengwei_Lu1

This issue has been really bugging me for 6 months. And I did “Detach deleted variable” commend.

It really polluted the design systems file.


Chris_Doner

This is still a problem. For us I believe what the biggest challenge is that we can’t really tell if a mode is a “ghost” ie truly a mode that has no variables being used, or if we really are still using variables from a deleted mode.

Has anyone found success with some sort of linter that can check for variables with deleted modes? Unfortunately we often have to delete / replace modes for a variety of limitations with the variable setup we have today.


Josh22
  • New Participant
  • 9 replies
  • August 15, 2024

I found that a problem is that I run the command for detach all variables and it says 0 instances found / 0 detached. But after digging into the component I find a reference somewhere buried deep into the component.

As an example, I copy a component from our design system library over (not an instance) because I want to experiment with an alternative layout or design. It doesn’t seem to have the problem as of late (maybe the updates fixed it for me), but this was where the issue typically came from.

For instance, I would see the variable modes (light, dark) as an option even know all references to it seemed to be removed. And I could apply that mode and it would work. Maybe it’s fixed now but if I come across the problem again I will mention it.


Barnes_Alison_M

I’m having the same issue.
I have “used” variables in my file that are not local but pulling from an entirely different file that I do not have access to. I would like to remove / detach them but I’m not able to do so after following the above recommendations.

Seems a bit silly to offer this powerful feature of variables but not provide solution for bugs when users have been expressing this issue for a year.


Kengwei_Lu1

Totally agree. At least provide an option to disconnect those old modes. It also helps to identify and reconnect variables/tokens if the old modes is removed.


I have the same issue and it has not been solved. The quick command to detach deleted variables does not work when using bringing in components for other files or libraries. This is common practice in larger organizations and you end up with a list (often with duplicates) of “Used” variables in your files that are ghosts. Why hasn’t this issue been fully addressed and will it ever? I was hoping the new version would have addressed this… but it’s still there. PLEASE HELP


gmcisaac
  • 3 replies
  • September 4, 2024

I am having the same issue. I am making a design system and have rebooted the project a few times but some things got copied over with old variables or variables from other design system component brought into the file. Very frustrating!!


Nouela
  • New Participant
  • 18 replies
  • September 4, 2024

I don’t think “detach deleted variables” does anything. Please help.


Nouela
  • New Participant
  • 18 replies
  • September 4, 2024

How did this help? Does this not just toggle the variables panel open/closed?


Nouela
  • New Participant
  • 18 replies
  • September 4, 2024

This simply does not work. Should I submit a bug or are the hundreds of other folks who submitted bugs enough?


Tyran_Van_Zyl

Happening to me too, no plugins seem to work. Also the “detach” with CMD+P does NOTHING


richpaul15

We’re still getting this too – same use case as most people on here: Page Variables that can’t be removed, and ghost ones appearing despite it being a new ‘clean’ document. Definitely an issue that still needs fixing.


elywahib
  • 4 replies
  • September 23, 2024

It’s not working, at least for me.


elywahib
  • 4 replies
  • September 23, 2024

Why hasn’t this bug been fixed yet?


Nouela
  • New Participant
  • 18 replies
  • September 23, 2024

Any updates on this issue? Just spent nearly a week using the Token Studio plug-in to scrub my file layer-by-layer, page-by-page. Ghost variables are still there.


Tony_Ke
  • 2 replies
  • September 26, 2024

Hello boss. Figma please dooooo something. I’ve got OCD, so seeing this really bothers me.


Alina_Peicheva

Hi Denise,

The issue highlighted in the video is slightly different from the one many of us are experiencing. Miggi demonstrated how to delete a variable created and deleted within the current file, but the main concern arises when we copy components from a different design system into our file. These components appear as “Used Variables” in the “Apply Variable Mode” tab. The challenge is figuring out how to remove these “Used Variables” without manually detaching each padding, gap, color, typography, etc.

Upon analysis, I found that this is not a bug because once all variables from the ‘foreign’ design system are detached and the page is reloaded, the “Used Variables” no longer appear. However, doing this manually is time-consuming, and I can tell you that 99% of the time, there will always be one lost ‘foreign’ variable that prevents the “Used Variables” from being completely removed. Therefore, I would be really happy if Figma introduced a “Detach All Used Variables” command. Currently, I address this by manually detaching all linked elements and refreshing the page, as without a refresh, it takes time to update.

Figma provides a “Copy variables into this file” option when pasting a UI element from a different file, which is useful. However, that’s not quite what we need in this case; we need a way to paste elements without any styles or variables. A new context menu option for “Paste without styles/variables” would be helpful.

I hope this clarifies the issue. I look forward to any ideas on adding these two features: the “Detach All Used Variables” command and the “Paste without styles/variables” functionality.

Thank you!


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