All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.node_modules.popper.js.src.utils.getStyleComputedProperty.js Maven / Gradle / Ivy

The newest version!
/**
 * Get CSS computed property of the given element
 * @method
 * @memberof Popper.Utils
 * @argument {Eement} element
 * @argument {String} property
 */
export default function getStyleComputedProperty(element, property) {
  if (element.nodeType !== 1) {
    return [];
  }
  // NOTE: 1 DOM access here
  const window = element.ownerDocument.defaultView;
  const css = window.getComputedStyle(element, null);
  return property ? css[property] : css;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy