Just like Swap Libraries, but for variables.
Run it from the Quick Actions or Plugin menu. Select some layers, choose source and destination variable collections and hit Swap button.
You can choose the scope for plugin: selection, current page, all pages or local styles.
After all, you may see some error. Click on them to focus viewport on problematic objects.
Swap Variables will display all local and enabled external variable collections that actually contains variables.
When you swap these collections, plugin will recursively find every used variable, then check two things:
- variable exists in source collection,
- destination collection containt variable with same group and name.
After the plugin ends its job, it will display known ecnountered errors below Swap button.
- If you modified external libraries, reload file to apply changes.
- Plugin doesn't swap styles. Use Swap Libraries instead.
- Plugin can't swap strokes in section. That’s not supported by Figma API yet. Do it manually instead.
- It may take some time to parse and swap variables when there're to many nodes or variables. Take a break and make some tea.
- Scoped variables was not tested.
- Clickable error allows to zoom in problematic layers.
- Collections with 0 variables are hidden.
- Ability to create new local collection.
- Typographic variables.
- Rebinding modes if the share the same name.
- Multipage swap.
- Swapping variables in local styles.
- Gradient support.
- Display number of variables in collection.
- Selecting the option that's in second select makes them swap.
I accept feature suggestions and ideas to improve the plugin. No need to mess with hidden layers? Useful exceptions? If you have any ideas or issues, let me know in the comments.
Alternatively you can contact me via e-mail at [email protected] and Telegram.