Pacote
    Preparing search index...

    Function getStyle

    • Reads an element's computed CSS property value.

      Parameters

      • element: HTMLElement

        Element whose computed style to read.

      • property: keyof CSSStyleDeclaration

        CSS property name.

      Returns string

      The computed property value.

      import { getStyle } from '@pacote/get-style'

      // When the body has a font size of 20px:
      getStyle(document.body, 'fontSize') // => '20px'