Working with Shared Styles
Bind reusable shared styles (text / fill / stroke / effect) to nodes by GUID. The <StyleId> is the style nodeId.
| Location | template |
|---|---|
| Local | xxxStyleId:<StyleId> |
| Team library | xxxStyleId:<StyleId>, libraryKey:<LibraryKey> |
title=I(parent, {type: "text", content: "Heading", textStyleId: "<StyleId>"})
card=I(parent, {type: "frame", fillStyleId: "<StyleId>"})
card=U("nodeId", {strokeStyleId: "<StyleId>"})
card=U("nodeId", {effectStyleId: "<StyleId>"})
libraryCard=I(parent, {type: "frame", fillStyleId: "366:20", libraryKey: "693499159567438"})
Style Rules
- ID format: pass the bare style nodeId. Do NOT prepend
$(that prefix is for variable references). textStyleIdis TEXT-only.fillStyleId/strokeStyleIdapply to any node with fills/strokes.effectStyleIdapplies to any node with effects.- Style binding wins at render time over inline
fontName/fills/strokes/effects— when binding a style, omit the matching literal property unless overriding for a single instance. - For team-library styles, pass
styleIdandlibraryKeyfromsearch_styles. - To remove a style binding, set the field to
null:
U("nodeId", {textStyleId: null, fillStyleId: null, strokeStyleId: null, effectStyleId: null})