UNPKG

934 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports["default"] = backgrounds;
5/**
6 * Shorthand that accepts any number of background values as parameters for creating a single background statement.
7 * @example
8 * // Styles as object usage
9 * const styles = {
10 * ...backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat')
11 * }
12 *
13 * // styled-components usage
14 * const div = styled.div`
15 * ${backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat')}
16 * `
17 *
18 * // CSS as JS Output
19 *
20 * div {
21 * 'background': 'url("/image/background.jpg"), linear-gradient(red, green), center no-repeat'
22 * }
23 */
24function backgrounds() {
25 for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
26 properties[_key] = arguments[_key];
27 }
28 return {
29 background: properties.join(', ')
30 };
31}
32module.exports = exports.default;
\No newline at end of file