resize_to_fit
Scale a Figma layer to fit inside a target frame with contain or cover, or shrink-wrap it tightly around its own children.
Instructions
Fit a layer. Two modes: (1) pass targetNodeId to scale nodeId to fit inside that layer, preserving aspect ratio and centering it (fit: 'contain' letterboxes, 'cover' fills and crops); (2) omit targetNodeId to shrink-wrap nodeId to tightly fit its own children (Figma's 'Resize to Fit').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | contain = fit entirely inside the target (default); cover = fill the target, cropping overflow. | |
| nodeId | Yes | The layer to resize or shrink-wrap. | |
| targetNodeId | No | Scale nodeId to fit inside this layer's bounds. Omit to shrink-wrap nodeId to its own children. |