@arche-mc2/arche-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
35 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var styles_1 = require("../Paragraph/styles");
var utils_1 = require("../../../Common/utils");
var typestyle_1 = require("typestyle");
var sizeMap = {
h1: 32,
h2: 26.7,
h3: 21.3,
h4: 18.7,
h5: 18,
h6: 16,
};
var calculateSize = function (tag) { return utils_1.default(sizeMap[tag]); };
var truncateCss = function (truncate) {
if (truncate) {
return {
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
};
}
return {};
};
var textTransformCss = function (upcase) {
if (upcase) {
return {
textTransform: 'uppercase',
};
}
return {};
};
exports.getStyles = function (props) { return (typestyle_1.style(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ fontSize: calculateSize(props.tag), textAlign: props.textAlign, color: props.color, letterSpacing: 'normal' }, truncateCss(props.truncate)), textTransformCss(props.upcase)), styles_1.marginCss(props.margin)))); };
//# sourceMappingURL=styles.js.map