@pacote/get-style
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

@pacote/get-style

version minified minified + gzip

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.

Readme

Keywords

Package Sidebar

Install

npm i @pacote/get-style

Weekly Downloads

1,214

Version

2.0.2

License

MIT

Unpacked Size

7.42 kB

Total Files

13

Last publish

Collaborators

  • goblindegook