All files / lib/mixins size.js

100% Statements 5/5
100% Branches 4/4
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39    1x                                                     3x   3x           1x 1x
"use strict";
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
 
 
/**
 * Mixin to set the height and width properties in a single statement.
 * @example
 * // Styles as object usage
 * const styles = {
 *   ...size('300px', '250px')
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   ${size('300px', '250px')}
 * `
 *
 * // CSS as JS Output
 *
 * div {
 *   'height': '300px',
 *   'width': '250px',
 * }
 */
 
function size(height) {
  var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : height;
 
  return {
    height: height,
    width: width
  };
}
 
exports.default = size;
module.exports = exports["default"];