Styles
CRUD for local paint, text, effect, and grid styles.
Type reference
// Styles are named, reusable design properties that can be applied to nodes. Four types:// paint: a named color (applied to fills/strokes), text: typography settings, effect: shadows/blurs, grid: layout grids.// All ID params accept both IDs and display names (case-insensitive). Use whichever you have.// ---// leadingTrim: "CAP_HEIGHT" trims line-height to cap height (tighter text boxes), "NONE" is default.// fontStyle: font variant name like "Bold", "Italic", "Bold Italic". Use fonts.list to find available styles.//// Effect object shape (for effect styles):// { type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR",// color?: Color, offset?: {x, y}, radius: number, spread?: number,// visible?: boolean, blendMode?: string }// DROP_SHADOW/INNER_SHADOW require color, offset, radius. LAYER_BLUR/BACKGROUND_BLUR require radius only.// Example: { type: "DROP_SHADOW", color: "#00000040", offset: {x:0,y:4}, radius: 8 }//// LayoutGrid object shape (for grid styles):// Rows/Columns: { pattern: "ROWS"|"COLUMNS", alignment: "MIN"|"MAX"|"STRETCH"|"CENTER",// gutterSize: number, count: number, sectionSize?: number, offset?: number, visible?: boolean, color?: Color }// Grid: { pattern: "GRID", sectionSize: number, visible?: boolean, color?: Color }// Example: { pattern: "COLUMNS", alignment: "STRETCH", gutterSize: 20, count: 12, offset: 40 }5 methods available.
List local styles with optional type filter
| Parameter | Type | Required | Description |
|---|---|---|---|
type | "paint" | "text" | "effect" | "grid" | ✗ | Filter by style type |
fields | string[] | ✗ | Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all. |
offset | number | ✗ | Skip N items for pagination (default 0) (default: 0) |
limit | number | ✗ | Max items per page (default 100) (default: 100) |
Response
| Field | Type | Description |
|---|---|---|
totalCount | number | Total matching items |
returned | number | Items in this page |
offset | number | |
limit | number | |
items | object[] | |
↳ id | string | |
↳ name | string | |
↳ type | string |
Get full style detail by ID
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Style ID or name |
fields | string[] | ✗ | Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all. |
Response
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
type | string | PAINT | TEXT | EFFECT | GRID |
paints | array | Paint fills (PAINT styles) |
fontFamily | string | Font family (TEXT styles) |
fontSize | number | Font size (TEXT styles) |
effects | array | Effects array (EFFECT styles) |
layoutGrids | array | Layout grids (GRID styles) |
create
Section titled “create”Create local styles
No parameters.
Discriminated by type. Available types:
Paint/color style
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Style name |
color | string | ✗ | Color value. Optional when colorVariableName is provided. |
colorVariableName | string | ✗ | Bind to a COLOR variable by name (style tracks the variable). Can be used alone — color is resolved from the variable. |
description | string | ✗ | Style description |
Text style
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Style name |
fontFamily | string | ✓ | Font family |
fontStyle | string | ✗ | Font style (default: Regular) |
fontSize | number | ✓ | Font size |
lineHeight | any | ✗ | number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"} |
letterSpacing | any | ✗ | number | {value, unit: "PIXELS"|"PERCENT"} |
textCase | "ORIGINAL" | "UPPER" | "LOWER" | "TITLE" | "SMALL_CAPS" | "SMALL_CAPS_FORCED" | ✗ | |
textDecoration | "NONE" | "UNDERLINE" | "STRIKETHROUGH" | ✗ | |
paragraphIndent | number | ✗ | Paragraph indent (px) |
paragraphSpacing | number | ✗ | Paragraph spacing (px) |
leadingTrim | "CAP_HEIGHT" | "NONE" | ✗ | Leading trim mode |
description | string | ✗ | Style description |
effect
Section titled “effect”Effect style
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Style name |
effects | array | ✓ | Array of Effect objects |
description | string | ✗ | Style description |
Grid/layout grid style
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Style name |
layoutGrids | array | ✓ | Array of LayoutGrid objects |
description | string | ✗ | Style description |
Response
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per input item |
↳ id | string |
update
Section titled “update”Update styles by ID or name
| Parameter | Type | Required | Description |
|---|---|---|---|
type | "paint" | "text" | "effect" | "grid" | ✗ | Style type hint for strict validation (optional, auto-detected) |
items | object[] | ✓ | Array of {id, ...fields} to update |
↳ id | string | ✓ | Style ID or name |
↳ name | string | ✗ | Rename the style |
↳ description | string | ✗ | Style description |
↳ color | string | ✗ | New color (paint styles) |
↳ colorVariableName | string | ✗ | Bind to a COLOR variable by name (paint styles) |
↳ fontFamily | string | ✗ | |
↳ fontStyle | string | ✗ | |
↳ fontSize | number | ✗ | |
↳ lineHeight | any | ✗ | number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"} |
↳ letterSpacing | any | ✗ | number | {value, unit: "PIXELS"|"PERCENT"} |
↳ textCase | "ORIGINAL" | "UPPER" | "LOWER" | "TITLE" | "SMALL_CAPS" | "SMALL_CAPS_FORCED" | ✗ | |
↳ textDecoration | "NONE" | "UNDERLINE" | "STRIKETHROUGH" | ✗ | |
↳ paragraphIndent | number | ✗ | Paragraph indent (px) |
↳ paragraphSpacing | number | ✗ | Paragraph spacing (px) |
↳ leadingTrim | "CAP_HEIGHT" | "NONE" | ✗ | |
↳ effects | array | ✗ | Array of Effect objects |
↳ layoutGrids | array | ✗ | Array of LayoutGrid objects (grid styles) |
Response
| Field | Type | Description |
|---|---|---|
results | any[] | Array of "ok" or {error} per item |
delete
Section titled “delete”Delete styles
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✗ | Style ID or name |
items | object[] | ✗ | Batch: [{id}, ...] |
↳ id | string | ✓ | Style ID or name |
Response
| Field | Type | Description |
|---|---|---|
results | string[] | Array of "ok" per item |