Get parent style

Get the parent style of a combo class style.

style.getParent()

Get the parent style of a class when you’ve determined that a style is a combo class and you want to:

  • Understand style inheritance - See which properties the combo class inherits versus overrides
  • Copy base styles - Apply the parent’s properties to other elements
  • Debug styling conflicts - Trace where specific CSS values originate
  • Build style auditing tools - Map the relationship between styles in a project

Syntax

1style.getParent(): Promise<Style | null>

Returns

Promise<Style | null>

A Promise that resolves to a Style object if a parent exists, or null if no parent is found.

Example

1// Audit combo class inheritance
2if (await style.isComboClass()) {
3 const parentStyle = await style.getParent();
4
5 if (parentStyle) {
6 const parentProps = await parentStyle.getProperties();
7 const comboProps = await style.getProperties();
8
9 console.log('Inherited from parent:', parentProps);
10 console.log('Overrides in combo class:', comboProps);
11 }
12} else {
13 console.log('Style is not a combo class - no parent exists');
14}

Designer ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny