@coreui/coreui-pro
Version:
UI Kit built on top of Bootstrap 4
36 lines (29 loc) • 1.04 kB
JavaScript
import "core-js/modules/es.string.match";
import "core-js/modules/es.string.replace";
/**
* --------------------------------------------------------------------------
* CoreUI Utilities (v2.1.14): get-style.js
* Licensed under MIT (https://coreui.io/license)
* --------------------------------------------------------------------------
*/
var minIEVersion = 10;
var isIE1x = function isIE1x() {
return Boolean(document.documentMode) && document.documentMode >= minIEVersion;
};
var isCustomProperty = function isCustomProperty(property) {
return property.match(/^--.*/i);
};
var getStyle = function getStyle(property, element) {
if (element === void 0) {
element = document.body;
}
var style;
if (isCustomProperty(property) && isIE1x()) {
var cssCustomProperties = getCssCustomProperties();
style = cssCustomProperties[property];
} else {
style = window.getComputedStyle(element, null).getPropertyValue(property).replace(/^\s/, '');
}
return style;
};
//# sourceMappingURL=get-style.js.map