Free tip: How to properly re-link detached remote styles

I was having this predicament after having split my unique Figma file into several, and having used the “swap library” probably incorrectly.

Anyway, here is a tip for any of you that finds him/herself in the following situation.

File A contains all the color fill, color stroke, text etc styles.
File B uses all of those styles everywhere, but all of them have been “detached” and only show as plain color values, font names and sizes and so on. This file contains no local styles at all.

How to re-link the styles from File B to those of the library file A ?

By combining two plugins ! “Styler” and “Style Organizer”.

First, open library file A, create a blank page and go to Styler > Extract styles.

this will generate something like this :

Select everything > group selection.

Now, the cumbersome part, open file B and repeat the following operation on every page (unfortunately “Style Organizer” does work on the current page only.

Paste the copied group from file A onto the current page of file B (temporarily).

Run “Style Organizer”, click “Scan this page” and it will show something like this, with all styles detached and at the same time recognizing that the same value is present in the group pasted from file A :

Now, since Style organizer has access exactly one instance of an item using the linked style from file A (inside the copied group), it will be able to use this information to automagically “merge” all objects using this value and apply the remote style to them.
Click “Auto Fix Color” and be patient, it can take some time. Once it’s done, here is how it looks :

Now switch to the “Text” tab and just click “Auto fix text” that will work in the same way.

Once you’re done with both, check any object on the current page, and it will have all the styles properly linked with the remote library File A.

Now select the group that you just pasted, cut it, and paste it on the next page and repeat.

Thanks a lot to the creators of both plug-ins !

I just wish “Style Organizer” had a mode to do all the same but directly on all pages of a document.

Here are the plugin download links (I’m not the author of either) :

Would be even easier if Figma was just able to natively re-link all detached styles to a selected library file :slight_smile:

2 Likes

Ah yes, a short explanation : The need to go through such a cumbersome process is because the plugin API does not have any way for plugins to access remote styles or components published from remote libraries, so the only way to work around it is to have at least one layer using the remote style to have a reference to it that the plugin can copy and apply to other layers.

1 Like

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