Get a style property on the passed element through the computed style. This function try to store the actual style to not trigger more that 1 redraw each js execution loop.
Name | Type | Description | Status | Default |
---|---|---|---|---|
elm | { HTMLElement } | The element to get style from | required | |
property | { String } | The css property to get | required |
Return { Mixed } The style value
import getStyleProperty from 'sugarcss/js/dom/getStyleProperty'
const opacity = getStyleProperty(myCoolHTMLElement, 'opacity');
See : See more : https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
Author : Olivier Bossel [email protected] https://olivierbossel.com