UNPKG

604 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports["default"] = size;
5/**
6 * Shorthand to set the height and width properties in a single statement.
7 * @example
8 * // Styles as object usage
9 * const styles = {
10 * ...size('300px', '250px')
11 * }
12 *
13 * // styled-components usage
14 * const div = styled.div`
15 * ${size('300px', '250px')}
16 * `
17 *
18 * // CSS as JS Output
19 *
20 * div {
21 * 'height': '300px',
22 * 'width': '250px',
23 * }
24 */
25function size(height, width) {
26 if (width === void 0) {
27 width = height;
28 }
29 return {
30 height: height,
31 width: width
32 };
33}
34module.exports = exports.default;
\No newline at end of file