UNPKG

702 BJavaScriptView Raw
1export const VALID_FONT_SCALES = __APPLE__ // Apple supports a wider number of font scales than Android does.
2 ? [0.5, 0.7, 0.85, 1, 1.15, 1.3, 1.5, 2, 2.5, 3, 3.5, 4]
3 : [0.85, 1, 1.15, 1.3];
4export function getClosestValidFontScale(fontScale) {
5 fontScale = Number(fontScale) || 1;
6 return VALID_FONT_SCALES.sort((a, b) => Math.abs(fontScale - a) - Math.abs(fontScale - b))[0];
7}
8export var FontScaleCategory;
9(function (FontScaleCategory) {
10 FontScaleCategory["ExtraSmall"] = "extra-small";
11 FontScaleCategory["Medium"] = "medium";
12 FontScaleCategory["ExtraLarge"] = "extra-large";
13})(FontScaleCategory || (FontScaleCategory = {}));
14//# sourceMappingURL=font-scale-common.js.map
\No newline at end of file