create_variable
Create a variable in a Figma collection with a specified type (BOOLEAN, FLOAT, STRING, COLOR). Starts empty, so set per-mode values and bind to nodes or paints later. Not for EASING/TIMING.
Instructions
Create a variable in a collection with resolvedType BOOLEAN / FLOAT / STRING / COLOR. The variable starts empty — set per-mode values with set_variable_value, then attach it with bind_variable_to_node or bind_variable_to_paint. EASING and TIMING variables cannot be created by plugins at all — Figma rejects it; they can only be made in the Figma UI. Returns { ok, variableId, name }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name, e.g. "color/primary" | |
| collectionId | Yes | Variable collection id | |
| resolvedType | Yes | Variable data type |