You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					35 lines
				
				914 B
			
		
		
			
		
	
	
					35 lines
				
				914 B
			| 
											3 years ago
										 | "use strict"; | ||
|  | 
 | ||
|  | exports.__esModule = true; | ||
|  | exports["default"] = backgroundImages; | ||
|  | 
 | ||
|  | /** | ||
|  |  * Shorthand that accepts any number of backgroundImage values as parameters for creating a single background statement. | ||
|  |  * @example | ||
|  |  * // Styles as object usage
 | ||
|  |  * const styles = { | ||
|  |  *   ...backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)') | ||
|  |  * } | ||
|  |  * | ||
|  |  * // styled-components usage
 | ||
|  |  * const div = styled.div`
 | ||
|  |  *   ${backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)')} | ||
|  |  * `
 | ||
|  |  * | ||
|  |  * // CSS as JS Output
 | ||
|  |  * | ||
|  |  * div { | ||
|  |  *   'backgroundImage': 'url("/image/background.jpg"), linear-gradient(red, green)' | ||
|  |  * } | ||
|  |  */ | ||
|  | function backgroundImages() { | ||
|  |   for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) { | ||
|  |     properties[_key] = arguments[_key]; | ||
|  |   } | ||
|  | 
 | ||
|  |   return { | ||
|  |     backgroundImage: properties.join(', ') | ||
|  |   }; | ||
|  | } | ||
|  | 
 | ||
|  | module.exports = exports.default; |