up.element.style(element, propOrProps)
JavaScript function
Returns computed CSS styles for the given element.
If a property is not set, it will be returned as an empty string.
Examples
When requesting a single CSS property, its value will be returned as a string:
let value = up.element.style(element, 'font-size')
// value is '16px'
When requesting multiple CSS properties, the function returns an object of property names and values:
let value = up.element.style(element, ['font-size', 'margin-top'])
// value is { 'font-size': '16px', 'margin-top': '10px' }
Parameters
element
required
Type: Element
propOrProps
Return value
The requested style value or values.
Type: string | Object