Last active
October 14, 2021 14:41
-
-
Save kemiljk/0932469ee92adb09b789e36f4bc8ace8 to your computer and use it in GitHub Desktop.
Scripter: Add Auto Layout to all of your individually selected Frames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { selection } = figma.currentPage; | |
const direction = "VERTICAL" // "HORIZONTAL" | |
const spacing = 24 // any number | |
const padding = 24 // any number | |
const vAlignment = "CENTER" // "MIN" (left) or "MAX" (right) | |
const hAlignment = "SPACE_BETWEEN" // "MIN" (top), "MAX" (bottom), "SPACE_BETWEEN" (stretch) | |
selection.forEach((node: FrameNode) => { | |
node.layoutMode = direction | |
node.itemSpacing = spacing | |
node.counterAxisAlignItems = vAlignment | |
node.primaryAxisAlignItems = hAlignment | |
node.paddingTop = padding | |
node.paddingBottom = padding | |
node.paddingLeft = padding | |
node.paddingRight = padding | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment