lib/resolver/cssGradient.js
function getPropertiesForGradient(gradients, property) {
		var props = [];
		var propertyName = property.name();
		var omitDir = prefs.get('css.gradient.omitDefaultDirection');
		
		if (prefs.get('css.gradient.fallback') && ~propertyName.toLowerCase().indexOf('background')) {
			props.push({
				name: 'background-color',
				value: '${1:' + gradients[0].gradient.colorStops[0].color + '}'
			});
		}
		
		var value = property.value();
		getGradientPrefixes('linear-gradient').forEach(function(prefix) {
			var name = cssResolver.prefixed(propertyName, prefix);
			if (prefix == 'webkit' && prefs.get('css.gradient.oldWebkit')) {
				try {
					props.push({
						name: name,
						value: insertGradientsIntoCSSValue(gradients, value, {
							prefix: prefix, 
							oldWebkit: true,
							omitDefaultDirection: omitDir
						})
					});
				} catch(e) {}
			}
			
			props.push({
				name: name,
				value: insertGradientsIntoCSSValue(gradients, value, {
					prefix: prefix,
					omitDefaultDirection: omitDir
				})
			});
		});
		
		return props.sort(function(a, b) {
			return b.name.length - a.name.length;
		});
	}
function getPropertiesForGradient(gradients, property) {
		var props = [];
		var propertyName = property.name();
		var omitDir = prefs.get('css.gradient.omitDefaultDirection');
		
		if (prefs.get('css.gradient.fallback') && ~propertyName.toLowerCase().indexOf('background')) {
			props.push({
				name: 'background-color',
				value: '${1:' + gradients[0].gradient.colorStops[0].color + '}'
			});
		}
		
		var value = property.value();
		getGradientPrefixes('linear-gradient').forEach(function(prefix) {
			var name = cssResolver.prefixed(propertyName, prefix);
			if (prefix == 'webkit' && prefs.get('css.gradient.oldWebkit')) {
				try {
					props.push({
						name: name,
						value: insertGradientsIntoCSSValue(gradients, value, {
							prefix: prefix, 
							oldWebkit: true,
							omitDefaultDirection: omitDir
						})
					});
				} catch(e) {}
			}
			
			props.push({
				name: name,
				value: insertGradientsIntoCSSValue(gradients, value, {
					prefix: prefix,
					omitDefaultDirection: omitDir
				})
			});
		});
		
		return props.sort(function(a, b) {
			return b.name.length - a.name.length;
		});
	}
function getPropertiesForGradient ( gradients , property ) { var props = [ ] ; var propertyName = property . name ( ) ; var omitDir = prefs . get ( 'css.gradient.omitDefaultDirection' ) ; if ( prefs . get ( 'css.gradient.fallback' ) && ~ propertyName . toLowerCase ( ) . indexOf ( 'background' ) ) { props . push ( { name : 'background-color' , value : '${1:' + gradients [ 0 ] . gradient . colorStops [ 0 ] . color + '}' } ) ; } var value = property . value ( ) ; getGradientPrefixes ( 'linear-gradient' ) . forEach ( function ( prefix ) { var name = cssResolver . prefixed ( propertyName , prefix ) ; if ( prefix == 'webkit' && prefs . get ( 'css.gradient.oldWebkit' ) ) { try { props . push ( { name : name , value : insertGradientsIntoCSSValue ( gradients , value , { prefix : prefix , oldWebkit : true , omitDefaultDirection : omitDir } ) } ) ; } catch ( e ) { } } props . push ( { name : name , value : insertGradientsIntoCSSValue ( gradients , value , { prefix : prefix , omitDefaultDirection : omitDir } ) } ) ; } ) ; return props . sort ( function ( a , b ) { return b . name . length - a . name . length ; } ) ; }
Returns list of CSS properties with gradient
@param {Array} gradient List of gradient objects
@param {CSSEditElement} property Original CSS property
@returns {Array}
Returns list of CSS properties with gradient