@pacote/get-style
Get an element's computed style for the provided CSS property.
Installation
yarn add @pacote/get-style
Usage
import { getStyle } from '@pacote/get-style'
// When the body element has `font-size: 20px`.
getStyle(document.body, 'fontSize') // => '20px'
getStyle(element: HTMLElement, property: string): string
getStyle()
takes an element and the CSS property to fetch and returns its
computed value.
License
MIT © Luís Rodrigues.