strokesIncludedInLayout
Applicable only on auto-layout frames. Determines whether strokes are included in layout calculations. When true, auto-layout frames behave like css box-sizing: border-box
.
Signature
strokesIncludedInLayout: boolean
Remarks
Auto-layout frame with strokes included in layout
const parentFrame = figma.createFrame()
parentFrame.appendChild(figma.createFrame())
parentFrame.appendChild(figma.createFrame())
parentFrame.layoutMode = 'HORIZONTAL'
// Let the height of the parent frame resize to fit the children
parentFrame.counterAxisSizingMode = 'AUTO'
// Thick stroke around parent frame to illustrate layout differences
parentFrame.strokes = [{ type: 'SOLID', color: { r: 0, g: 0, b: 0 }}]
parentFrame.strokeWeight = 10
// Parent frame (strokes overlap with children)
// +--------------------------+
// |+-----------++-----------+|
// || || ||
// || Child 1 || Child 2 ||
// || || ||
// |+-----------++-----------+|
// +--------------------------+
parentFrame.strokesIncludedInLayout = false
// Parent frame (strokes do not overlap with children)
// +--------------------------------+
// | |
// | +-----------++-----------+ |
// | | || | |
// | | Child 1 || Child 2 | |
// | | || | |
// | +-----------++-----------+ |
// | |
// +--------------------------------+
parentFrame.strokesIncludedInLayout = true