cq-prolyfill.js
function getOriginalStyle(element, prop) {

	var matchedRules = [];
	var value;
	var j;

	matchedRules = sortRulesBySpecificity(
		filterRulesByElementAndProp(styleCache[prop], element, prop)
	);

	// Add style attribute
	matchedRules.unshift({
		_rule: {
			style: element.style,
		},
	});

	// Loop through all important styles
	for (j = 0; j < matchedRules.length; j++) {
		if (
			(value = matchedRules[j]._rule.style.getPropertyValue(prop))
			&& matchedRules[j]._rule.style.getPropertyPriority(prop) === 'important'
		) {
			return value;
		}
	}

	// Loop through all non-important styles
	for (j = 0; j < matchedRules.length; j++) {
		if (
			(value = matchedRules[j]._rule.style.getPropertyValue(prop))
			&& matchedRules[j]._rule.style.getPropertyPriority(prop) !== 'important'
		) {
			return value;
		}
	}

	return undefined;

}
function getOriginalStyle(element, prop) {

	var matchedRules = [];
	var value;
	var j;

	matchedRules = sortRulesBySpecificity(
		filterRulesByElementAndProp(styleCache[prop], element, prop)
	);

	// Add style attribute
	matchedRules.unshift({
		_rule: {
			style: element.style,
		},
	});

	// Loop through all important styles
	for (j = 0; j < matchedRules.length; j++) {
		if (
			(value = matchedRules[j]._rule.style.getPropertyValue(prop))
			&& matchedRules[j]._rule.style.getPropertyPriority(prop) === 'important'
		) {
			return value;
		}
	}

	// Loop through all non-important styles
	for (j = 0; j < matchedRules.length; j++) {
		if (
			(value = matchedRules[j]._rule.style.getPropertyValue(prop))
			&& matchedRules[j]._rule.style.getPropertyPriority(prop) !== 'important'
		) {
			return value;
		}
	}

	return undefined;

}
function getOriginalStyle ( element , prop ) { var matchedRules = [ ] ; var value ; var j ; matchedRules = sortRulesBySpecificity ( filterRulesByElementAndProp ( styleCache [ prop ] , element , prop ) ) ; // Add style attribute matchedRules . unshift ( { _rule : { style : element . style , } , } ) ; // Loop through all important styles for ( j = 0 ; j < matchedRules . length ; j ++ ) { if ( ( value = matchedRules [ j ] . _rule . style . getPropertyValue ( prop ) ) && matchedRules [ j ] . _rule . style . getPropertyPriority ( prop ) === 'important' ) { return value ; } } // Loop through all non-important styles for ( j = 0 ; j < matchedRules . length ; j ++ ) { if ( ( value = matchedRules [ j ] . _rule . style . getPropertyValue ( prop ) ) && matchedRules [ j ] . _rule . style . getPropertyPriority ( prop ) !== 'important' ) { return value ; } } return undefined ; }
Get the original style of an element as it was specified in CSS

@param  {Element} element
@param  {string}  prop    Property to return, e.g. `width` or `height`
@return {string}
Get the original style of an element as it was specified in CSS