Skip to main content
megaroeny
Active Member
August 19, 2021

Finding Missing Library components/styles

  • August 19, 2021
  • 91 replies
  • 25524 views

First off, I’m loving the new Swap Library feature!

Problem

Today, it actually helped me discover some “rogue” styles and components that were leftover from an old library! Now I can try to locate those and finally get rid of them in our current library!

But wait - what if I don’t actually know where these are in the file? Or even further, what if I can’t get Figma to find a match?

Suggestions:

  1. The one thing I wish this feature could do is to help me actually locate those rogue styles or components. I tried using the Instance Finder plugin but it still didn’t help because I have to actually locate them on the canvas/file first. ☹
  2. What if the dialog let us force a new style or component match, instead of us running into a dead-end with the None found message. Currently, it tries to match using the name. But that might not always work (like in this case.)

Any ideas are appreciated. Otherwise, wanted to pass this suggestion on to the Figma team. Thanks!

91 replies

Julia_Shlyapnikova
Active Member
September 7, 2021

Same issue. Cannot find any of the ‘missing’ styles. I’ve checked everything: hidden layers, unions and subtracts, I’ve managed to reduce the number of the the ghosts, but still have some, and it drives me crazy.

Danny_Marsh
September 8, 2021

I am also getting some cases where a match is found. Yet when I click Swap library the old style persists.

megaroeny
megaroenyAuthor
Active Member
September 8, 2021

What’s interesting for me, is my missing library has similar names of styles or components (not exact) to my active/current library. Yet it won’t let me swap them (the option is disabled.) 😞

Pete_Lada
September 21, 2021

This is a hack, but I was having a ton of trouble finding some rogue styles that were missing. They didn’t show up with any plugins. I was able to find them by running:

figma.currentPage.findAll(n => {
    var style = figma.getStyleById(n.effectStyleId);
    if (style) {
        console.log(style.name)
        if (style.name === "[ style name you're looking for]") {
            figma.currentPage.selection = [n];
        }
    }
})

in console on each page. As long as you know the style name you should be able to find the layers this way.

You can do this with text styles, fill styles, effect styles, etc

megaroeny
megaroenyAuthor
Active Member
September 22, 2021

Oh, cool! I will definitely try this out. Always fun to fiddle with the console (when you know how 😄 )

Update: @Pete_Lada I tried it out but appears to get no results? This is what I see:
image

for this:

image

Pete_Lada
September 22, 2021

Are you sure its an effect style? Like is this a fill style (color?)

megaroeny
megaroenyAuthor
Active Member
September 22, 2021

Oh!! 🤔 Good question. Maybe what I’m seeing (in the screenshot above) is actually an Effect style? Is that what you’re asking?

If it is an Effect, can I change the code snippet to find effects instead of fills?

Pete_Lada
September 22, 2021

The snippet you linked is specifically looking for effect style names. You can change that bit to fillStyleId or textStyleId to find the names of those style types instead

megaroeny
megaroenyAuthor
Active Member
September 22, 2021

Ohhhh! I see what you mean, thanks for pointing that out. Appreciate it.

Brendan_Tobin
October 5, 2021

As a workaround, Style Organiser helps to locate linked styles on the board. This is particularly good if your Library is made of local components, as remote styles are highlighted.

The plugin is Style Organiser (by SHOPEE SINGAPORE PRIVATE LIMITED)