Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 1.12 KB

getStyleProperty.md

File metadata and controls

24 lines (17 loc) · 1.12 KB

getStyleProperty

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.

Parameters

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

Example

	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