| 31 | * @param el HTML Element to measure. |
| 32 | */ |
| 33 | export function outerSize(el: HTMLElement) { |
| 34 | const cs = getComputedStyle(el); |
| 35 | const height = parseFloat(cs.marginTop) + parseFloat(cs.paddingTop) + parseFloat(cs.borderTopWidth) + el.offsetHeight + parseFloat(cs.borderBottomWidth) + parseFloat(cs.paddingBottom) + parseFloat(cs.marginBottom); |
| 36 | const width = parseFloat(cs.marginLeft) + parseFloat(cs.paddingLeft) + parseFloat(cs.borderLeftWidth) + el.offsetWidth + parseFloat(cs.borderRightWidth) + parseFloat(cs.paddingRight) + parseFloat(cs.marginRight); |
| 37 | return { height, width }; |
| 38 | } |