Skip to content
  1. API
  2. StyleRule

StyleRule ​

Controller class for a style rule, used to update and manage the attributes and selectors associated with the rule.

styleRule.destroy() ​

Delete the rule. After this is called, a call to any method on this object will throw an error.

Returns

  • Promise<void>

styleRule.getId() ​

Returns the unique positive integer rule id associated with the rule.

Returns

  • number

styleRule.getIndex() ​

Retrieve the position of the rule in the internal rule list. Rules with a higher index are applied after rules with a lower index.

Returns

  • number

styleRule.refresh() ​

Refresh the rule for all nodes.

Returns

  • Promise<void>

styleRule.setIndex(index) ​

Assign the position of the rule in the internal rule list. Rules with a higher index are applied after rules with a lower index.

Arguments

  • index number

Returns

  • Promise<void>

styleRule.update(options) ​

Updates the attributes and selectors associated with the rule.

Arguments

Returns

  • Promise<void>

styleRule.whenApplied() ​

Call the specified function when the rule is applied for the first time.

Returns