@helpscout/hsds-react
Version:
React component library for Help Scout's Design System
41 lines (29 loc) • 1.19 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.makeFontFamily = exports.makeFontFamilyFactory = exports.setFontSize = void 0;
var _lodash = _interopRequireDefault(require("lodash.isnumber"));
var _variableFontSize = require("./variableFontSize");
var _constants = require("../configs/constants");
var setFontSize = function setFontSize(size) {
var computedSize = (0, _lodash.default)(size) ? size + "px" : size;
return _variableFontSize.GLOBAL_FONT_SIZE_NAMESPACE + ": " + computedSize;
};
exports.setFontSize = setFontSize;
var makeFontFamilyFactory = function makeFontFamilyFactory(fonts, baseFont) {
if (baseFont === void 0) {
baseFont = _constants.FONT_FAMILY;
}
return function () {
if (!fonts) {
return "font-family: " + baseFont + ";";
} else {
return "\n font-family: " + fonts + ", " + baseFont + ";\n ";
}
};
};
exports.makeFontFamilyFactory = makeFontFamilyFactory;
var makeFontFamily = function makeFontFamily(fonts) {
return makeFontFamilyFactory(fonts, _constants.FONT_FAMILY);
};
exports.makeFontFamily = makeFontFamily;
;