UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

21 lines (20 loc) 742 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findTypographyTokenForValues = findTypographyTokenForValues; var _typographyValueToToken = require("./typography-value-to-token"); function findTypographyTokenForValues(fontSize, lineHeight) { // Match 11px to 12px as this is what happened when transitioning from legacy to refreshed typography if (fontSize === '11px') { fontSize = '12px'; } var matchingTokens = _typographyValueToToken.typographyValueToToken.filter(function (token) { return token.values.fontSize === fontSize; }) // If lineHeight == 1, we don't match to a token .filter(function () { return lineHeight === '1' ? false : true; }); return matchingTokens; }