Figma Plugin: Theemo
Figma plugin to automate your styles. It's main purpose is to allow you to have an origin style mapped to a reference style, which will kept in sync with the origin style.
This plugin will let you do this:
- Manage style references on a selected node
- Auto-update all references as you change origins (keep the plugin open for this)
- Export references to make it available for third-party consumers
- Import references (in case you duplicated a document)
- Switch contexts
1. Manage References
Select a node for which you want to manage references, eg. a rectangle. Open the "Theemo" plugin and a dialog will appear that let you do it. Currently these styles are supported:
- Fill Style
- Stroke Style
- Effect Style
For each of those there is a section in the dialog where you can manage the origin style to the reference.
- Origin That's the original style.
- Reference That's the style to which the origin is copied over when references are updated.
For paint styles (Fill and Stroke) transforms are available. When styles are referenced from origin to reference you can put transforms in between. Availabe are HSL + Opacity values. They will be applied during referencing.
Use this to automate your color palette. Make one color swatch for your base value (e.g. "Brand / 500"). A darker color would take your base value as reference and set lightness to "-20" - name it for example "Brand / 300".
You can export your references to jsonbin.io and by that make it available for third-party consumers, e.g. if you want to update your design tokens in your code. Here is how:
Enter credentials in settngs:
- Create an account and copy the API Key
- Create a bin and copy the bin URL
On the tools tab the
Export Settings button becomes available. Clicking the
button will export your references.
You can import your earlier exported references from jsonbin.io. That is really helpful when you duplicated your document - figma will not copy over your stored references. Here is how to import references:
- Duplicate a document
- Open the old document, open the plugin, go to settings and copy the Bin URL
- Go the new new document (the plugin should still be opened), paste the URL into the input for import and click the button next to it.
- A notification will appear telling you how much references were imported.
- You can work with your new document the same way as the old one now - win!
Contexts are a lightweight way to organize various theme modes within one
document. E.g. if you have light and dark mode in one document, you may want to
give styles for respective styles a specific suffix, e.g.
.$dark - With
defined contexts, you can swap between them quickly and then use
Themer to export
Use it in combination with Themer:
- Set your variants for each context (
- Select a context
Theemoto map those "compiled" styles
Themerto export and apply them
Things to Know
When setting the origin style the suggestions only show local styles, that is also due to limitations of the current figma API, given security reasons for shared team libraries. That's fair - figma keeps us safe, give them credit for that :)
It still is possible to use library styles, then you can't use the style references manage dialog, instead manually assign those style and THEN use the theemo dialog in order to persist it.
Once you have one node "under management", you may want to change the local style but once you update references, those new ones will be overridden. Re-select the node again and the references dialog will provide you options for migrating styles, to either keep the old one or use the new one.
Once you link origin to reference the node itself will show the reference as its local style, which might give you wonders, yet is expected and the correct behavior.
To develop this on your own. Install depencencies first:
Second, start the watch server: