@gannochenko/ui.styled-components
Version:
<!-- PROJECT SHIELDS --> <!-- *** Reference links are enclosed in brackets [ ] instead of parentheses ( ). *** See the bottom of this document for the declaration of the reference variables *** for contributors-url, forks-url, etc. This is an optional, co
25 lines • 846 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.rectangle = void 0;
const op_1 = require("./op");
const rectangle = (height = null, width = null, k) => {
let realHeight = height;
let realWidth = width;
if (realHeight === null) {
realHeight = realWidth;
}
else if (realWidth === null) {
realWidth = realHeight;
}
const realCoefficient = k !== null && k !== void 0 ? k : 1;
if (realCoefficient !== 1) {
realWidth = (0, op_1.op)(width, (v) => v * realCoefficient);
realHeight = (0, op_1.op)(height, (v) => v * realCoefficient);
}
return `
${realWidth !== null ? `width: ${realWidth};` : ''}
${realHeight !== null ? `height: ${realHeight};` : ''}
`;
};
exports.rectangle = rectangle;
//# sourceMappingURL=rectangle.js.map