lib/resolver/cssGradient.js
function insertGradientsIntoCSSValue(gradients, value, options) {
		// gradients *should* passed in order they actually appear in CSS property
		// iterate over it in backward direction to preserve gradient locations
		options = options || {};
		gradients = utils.clone(gradients);
		gradients.reverse().forEach(function(item, i) {
			var suffix = !i && options.placeholder ? options.placeholder : '';
			var str = options.oldWebkit ? item.gradient.stringifyOldWebkit(options) : item.gradient.stringify(options);
			value = utils.replaceSubstring(value, str + suffix, item.matchedPart);
		});

		return value;
	}
function insertGradientsIntoCSSValue(gradients, value, options) {
		// gradients *should* passed in order they actually appear in CSS property
		// iterate over it in backward direction to preserve gradient locations
		options = options || {};
		gradients = utils.clone(gradients);
		gradients.reverse().forEach(function(item, i) {
			var suffix = !i && options.placeholder ? options.placeholder : '';
			var str = options.oldWebkit ? item.gradient.stringifyOldWebkit(options) : item.gradient.stringify(options);
			value = utils.replaceSubstring(value, str + suffix, item.matchedPart);
		});

		return value;
	}
function insertGradientsIntoCSSValue ( gradients , value , options ) { // gradients *should* passed in order they actually appear in CSS property // iterate over it in backward direction to preserve gradient locations options = options || { } ; gradients = utils . clone ( gradients ) ; gradients . reverse ( ) . forEach ( function ( item , i ) { var suffix = ! i && options . placeholder ? options . placeholder : '' ; var str = options . oldWebkit ? item . gradient . stringifyOldWebkit ( options ) : item . gradient . stringify ( options ) ; value = utils . replaceSubstring ( value , str + suffix , item . matchedPart ) ; } ) ; return value ; }
Replaces old gradient definitions in given CSS property value
with new ones, preserving original formatting
@param  {Array} gradients List of CSS gradients
@param  {String} value     Original CSS value
@param  {Object} options   Options for gradient’s stringify() method
@return {String}
Replaces old gradient definitions in given CSS property value with new ones preserving original formatting