create_variable
Create a variable within a Figma collection by specifying its name, data type, and optional per-mode values for design token management.
Instructions
Create a variable inside a collection, optionally seeding per-mode values. COLOR values are { r, g, b, a } (0-1). Get modeIds from get_variables or create_variable_collection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the variable (use slashes to group, e.g. "color/primary") | |
| collectionId | Yes | The ID of the variable collection to create the variable in | |
| resolvedType | Yes | The resolved data type of the variable | |
| valuesByMode | No | Map of modeId -> value. For COLOR use { r, g, b, a } (0-1); FLOAT a number; STRING a string; BOOLEAN a boolean. |