UNPKG

1.09 kBJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports["default"] = borderWidth;
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 * ...borderWidth('12px', '24px', '36px', '48px')
13 * }
14 *
15 * // styled-components usage
16 * const div = styled.div`
17 * ${borderWidth('12px', '24px', '36px', '48px')}
18 * `
19 *
20 * // CSS as JS Output
21 *
22 * div {
23 * 'borderTopWidth': '12px',
24 * 'borderRightWidth': '24px',
25 * 'borderBottomWidth': '36px',
26 * 'borderLeftWidth': '48px'
27 * }
28 */
29function borderWidth() {
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, ['borderWidth'].concat(values));
34}
35module.exports = exports.default;
\No newline at end of file