apply_theme
Switch a Figma file to a theme and resolve all tokens to concrete values, bypassing the 'Apply' step in Tokens Studio. Handles color, spacing, typography, shadows, and more with optional dry run.
Instructions
Switch the file to a theme and resolve every applied token to its concrete value. Sets the file's activeTheme + usedTokenSet shared plugin data (so Tokens Studio recognizes the switch), then walks the subtree and writes resolved values directly via the plugin — no need to click 'Apply' in Tokens Studio. Supports color (fill/stroke), spacing/padding (all 4 axes), border radius/width, opacity, sizing, composition (auto-expanded into their constituent property writes), typography (font family / weight / size / line-height / letter-spacing — pre-loads fonts in parallel), and shadow (drop / inner via the effects array). Math expressions like {base.size.4} * 2 are evaluated; references are followed (cycle-protected at depth 16). Hidden nodes are skipped by default for both performance and intent. Pass dryRun: true to see what would be written without touching the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| scope | No | ||
| dryRun | No | ||
| nodeId | No | ||
| fileKey | No | ||
| onlyColor | No | ||
| setActive | No | ||
| themeName | Yes | ||
| skipHidden | No | ||
| bindingMode | No |