@untemps/utils - v3.1.0
    Preparing search index...

    Function getCSSDeclaration

    • Parameters

      • className: string

        The name of the CSS declaration to return. You may ignore the starting dot.

      • returnText: boolean = false

        true to get a string representation of the CSS declaration.

      Returns string | CSSStyleDeclaration | null

      The CSS declaration or null if the CSS declaration is not found.

      import { getCSSDeclaration } from '@untemps/utils/dom/getCSSDeclaration'

      const styleElement = document.createElement('style')
      styleElement.textContent = '.drag { background-color: black; }'
      document.head.appendChild(styleElement)

      const className = '.drag'
      const returnText = true
      getCSSDeclaration(className, returnText) // background-color: black;