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

style.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

// Audit combo class inheritance
if (await style.isComboClass()) {
const parentStyle = await style.getParent();
if (parentStyle) {
const parentProps = await parentStyle.getProperties();
const comboProps = await style.getProperties();
console.log('Inherited from parent:', parentProps);
console.log('Overrides in combo class:', comboProps);
}
} else {
console.log('Style is not a combo class - no parent exists');
}

Designer ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny