Get style property
style.getProperty(prop, options?)
Retrieve the value of a specific property in a Style object.
Syntax
Parameters
-
options: BreakpointAndPseudo (optional)
An object that lets you filter properties by breakpoint and/or pseudo-state.
-
BreakpointId
: Identifies the responsive breakpoint to get styles for. -
PseudoStateKey
: Specifies a CSS pseudo-class to get styles for.
-
Returns
Promise<PropertyMap | 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 does not exist for the provided style property, this method will returnnull
.
Example
Designer Ability
Checks for authorization only