Get style property
style.getProperty(prop, options?)
Retrieve the value of a specific css property in a Style object.
Syntax
Parameters
-
prop: StyleProperty - The property to get. See the Style Properties reference for a list of supported properties. -
options: StyleOptions - An object that filters properties by breakpoint, pseudo-state, and/or variant. (Optional)-
breakpoint: BreakpointId - Identifies the responsive breakpoint to get styles for. -
pseudo: PseudoStateKey - Specifies a CSS pseudo-class to get styles for. -
variantId: string - The ID of the variant to target.'base'is not a valid value. (Optional)
-
Returns
Promise<PropertyMap[p] | Variable | null>
Returns a Promise that resolves to:
- PropertyMap[p] - The value of the provided style property, if one exists.
- A Variable representing the value of the provided style property, if a variable is used as the value of the provided style property.
null- If value doesn’t exist for the provided style property, this method will returnnull.
Example
Designer Ability
Checks for authorization only