@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
21 lines (19 loc) • 695 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findFontWeightTokenForValue = findFontWeightTokenForValue;
var _fontWeightTokens = require("./font-weight-tokens");
function findFontWeightTokenForValue(fontWeight) {
var tokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _fontWeightTokens.fontWeightTokens;
if (fontWeight === 'normal') {
fontWeight = '400';
}
// Match bold and 700 to 653 to match with bold weight refreshed typography
if (fontWeight === 'bold' || fontWeight === '700') {
fontWeight = '653';
}
return tokens.find(function (token) {
return token.values.fontWeight === fontWeight;
});
}