.getStyle(...properties?)
Available on: InDom Gets computed CSS value(s) for the underlying element. Parameters: } -
...properties {string} [optional] - Zero or more CSS property names (dash-case).
Returns: {CSSStyleDeclaration | string | ObjectFull CSSStyleDeclaration when no arguments supplied.
Computed value as string when exactly one property supplied.
Object map { prop: value } when two or more properties supplied.
Throws: Error - If the underlying element has been removed
Examples:const div = $n('');
$1('body').append(div);
// single property
div.setStyle('background-color', 'blue');
console.log(div.getStyle('background-color'));
// rgb(0, 0, 255)
// bulk assignment + multi-read
div.setStyle({ width: '100px', height: '50px', fontSize: '16px' });
console.log(div.getStyle('width', 'height', 'font-size'));
// {width: '100px', height: '50px', 'font-size': '16px'}
// apply to collection
$a('.example>div').setStyle({ color: 'blue', 'font-size': '15px' });
// inspect every computed property
const styles = $1('.example>div').getStyle();
console.log([styles.color, styles.fontSize]);
// ['rgb(0, 0, 255)', '15px']