getStyle
Call Signature
Section titled “Call Signature”getStyle(
element,property):string
Defined in: core/dom/styles.ts:52
Returns the computed value of a CSS property, e.g. '10px'. It is '' if the
property does not exist.
Pass an array of properties to read several at once. The result then maps each property to its value.
Properties are CSS names, with hyphens: 'margin-right', not 'marginRight'.
Note that setStyles takes camelCase names instead.
Parameters
Section titled “Parameters”element
Section titled “element”Element
Element to read from.
property
Section titled “property”string
CSS property name.
Returns
Section titled “Returns”string
Example
Section titled “Example”getStyle(box, 'margin-right'); // '10px'getStyle(box, ['margin-right', 'margin-left']); // { 'margin-right': '10px', 'margin-left': '10px' }Call Signature
Section titled “Call Signature”getStyle(
element,properties):Record<string,string>
Defined in: core/dom/styles.ts:57
Parameters
Section titled “Parameters”element
Section titled “element”Element
Element to read from.
properties
Section titled “properties”string[]
CSS property names.
Returns
Section titled “Returns”Record<string, string>