Bind raw colors to variables
figma_bind_tokensFinds unbound solid fills, strokes, and styled text colors in selected Figma layers, then binds each to an exactly matching variable from a collection and reports changed paints and unmatched colors.
Instructions
Finds solid colors (fills, strokes and styled text ranges) in the given layers that are not bound to a variable, and binds each to the variable in a collection whose value matches exactly. Use after building or importing layers so they follow the design tokens. Returns how many paints changed and which colors had no matching token.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"node_ids": "<node_ids>",
"collection": "<collection>"
},
"name": "figma_bind_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Figma link (or file key) of the file to edit. Needed only when the plugin is open in more than one file. | |
| skip | No | Variables never chosen by value, e.g. role tokens that share a value with a base token ("color/on-highlight") | |
| prefer | No | Variables chosen first when several share a value | |
| rebind | No | Also re-match paints currently bound to a skipped variable | |
| node_ids | Yes | Root layers to process (their whole subtrees) | |
| collection | Yes | Variable collection name or id to match against | |
| translucent | No | Also bind paints with opacity below 1 (scrims, tints); off by default |