UNPKG

polished

Version:

A lightweight toolset for writing styles in Javascript.

35 lines (34 loc) 1.09 kB
"use strict"; exports.__esModule = true; exports["default"] = borderColor; var _directionalProperty = _interopRequireDefault(require("../helpers/directionalProperty")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. * @example * // Styles as object usage * const styles = { * ...borderColor('red', 'green', 'blue', 'yellow') * } * * // styled-components usage * const div = styled.div` * ${borderColor('red', 'green', 'blue', 'yellow')} * ` * * // CSS as JS Output * * div { * 'borderTopColor': 'red', * 'borderRightColor': 'green', * 'borderBottomColor': 'blue', * 'borderLeftColor': 'yellow' * } */ function borderColor() { for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { values[_key] = arguments[_key]; } return _directionalProperty["default"].apply(void 0, ['borderColor'].concat(values)); } module.exports = exports.default;