@inkline/inkline
Version:
Inkline is the Vue.js UI/UX Library built for creating your next design system
13 lines (10 loc) • 465 B
text/typescript
export function getStyleProperty (element: HTMLElement, property: string): any {
if (!element || !property || typeof window === 'undefined') { return; }
if ((element as any).currentStyle) {
return (element as any).currentStyle[property];
}
const computedStyle = window.getComputedStyle(element, null);
return computedStyle.getPropertyValue
? computedStyle.getPropertyValue(property)
: computedStyle[property as any];
}