Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
rule.each(function (decl, i) {
if (decl.type !== 'decl') { return; }
var value = decl.value;
if (value.indexOf('rem') !== -1) {
var prop = vendor.unprefixed(decl.prop);
// replace rems only if needed
var isFontShorthand = (prop === 'font');
var isSpecialCaseIE9_10 = (isIE9_10 && (isPseudoElement || isFontShorthand));
var isUseless = (!isIE9_10 && !(_VALUES.test(value) || _PROPS.test(prop)));
if ( isSpecialCaseIE9_10 || isUseless ) {
value = value.replace(_remgex, function ($1) {
// Round decimal pixels down to match webkit and opera behavior:
// http://tylertate.com/blog/2012/01/05/subpixel-rounding.html
return Math.floor(parseFloat($1) * toPx(_rootvalue)) + 'px';
});
if (_options.replace) {
decl.value = value;
} else {
Prefixes.prototype.prefixed = function prefixed(prop, prefix) {
prop = vendor.unprefixed(prop);
return this.decl(prop).prefixed(prop, prefix);
};
Prefixes.prototype.unprefixed = function unprefixed(prop) {
var value = this.normalize(vendor.unprefixed(prop));
if (value === 'flex-direction') {
value = 'flex-flow';
}
return value;
};
Prefixes.prototype.unprefixed = function unprefixed(prop) {
var value = this.normalize(vendor.unprefixed(prop));
if (value === 'flex-direction') {
value = 'flex-flow';
}
return value;
};
Prefixes.prototype.prefixed = function prefixed(prop, prefix) {
prop = vendor.unprefixed(prop);
return this.decl(prop).prefixed(prop, prefix);
};
Prefixes.prototype.unprefixed = function unprefixed(prop) {
var value = this.normalize(vendor.unprefixed(prop));
if (value === 'flex-direction') {
value = 'flex-flow';
}
return value;
};
Prefixes.prototype.unprefixed = function unprefixed(prop) {
var value = this.normalize(vendor.unprefixed(prop));
if (value === 'flex-direction') {
value = 'flex-flow';
}
return value;
};
Prefixes.prototype.prefixed = function prefixed(prop, prefix) {
prop = vendor.unprefixed(prop);
return this.decl(prop).prefixed(prop, prefix);
};
Prefixes.prototype.prefixed = function prefixed(prop, prefix) {
prop = vendor.unprefixed(prop);
return this.decl(prop).prefixed(prop, prefix);
};