UNPKG

1.05 kBJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports["default"] = padding;
5var _directionalProperty = _interopRequireDefault(require("../helpers/directionalProperty"));
6function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7/**
8 * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions.
9 * @example
10 * // Styles as object usage
11 * const styles = {
12 * ...padding('12px', '24px', '36px', '48px')
13 * }
14 *
15 * // styled-components usage
16 * const div = styled.div`
17 * ${padding('12px', '24px', '36px', '48px')}
18 * `
19 *
20 * // CSS as JS Output
21 *
22 * div {
23 * 'paddingTop': '12px',
24 * 'paddingRight': '24px',
25 * 'paddingBottom': '36px',
26 * 'paddingLeft': '48px'
27 * }
28 */
29function padding() {
30 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
31 values[_key] = arguments[_key];
32 }
33 return _directionalProperty["default"].apply(void 0, ['padding'].concat(values));
34}
35module.exports = exports.default;
\No newline at end of file