@bootstrap-styled/css-utils
Version:
Bootstrap mixins and utilities in javascript for bootstrap-styled.
38 lines (35 loc) • 1.11 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getSizingUtilities = getSizingUtilities;
exports.default = exports.defaultProps = void 0;
var defaultProps = {
$sizes: {
25: '25%',
50: '50%',
75: '75%',
100: '100%'
}
};
exports.defaultProps = defaultProps;
function getSizingUtilities() {
var sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultProps['$sizes'];
// eslint-disable-line dot-notation
var abbrev = {
width: 'w',
height: 'h'
};
var sizingList = [];
Object.keys(abbrev).forEach(function (cssProp) {
Object.keys(sizes).forEach(function (size) {
sizingList.push("\n .".concat(abbrev[cssProp], "-").concat(size, " { ").concat(cssProp, ": ").concat(sizes[size], " !important; }\n "));
});
});
return "\n ".concat(sizingList.join('\n'), "\n .mw-100 { max-width: 100% !important; }\n .mh-100 { max-height: 100% !important; }\n ");
}
var _default = {
defaultProps: defaultProps,
getSizingUtilities: getSizingUtilities
};
exports.default = _default;
;