UNPKG

@retriever-ui/system

Version:
33 lines (32 loc) 1.17 kB
"use strict"; var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); // TODO: Refactor typography custom object to remove desktop or mobile validation var getFontTheme = function (theme, property) { if (!property) return; if (typeof property === 'number') return property; var isParagraph = property.includes('paragraph'); var isHeading = property.includes('heading'); if (!isParagraph && !isHeading) return property; var _a = __read(property.split('.'), 2), type = _a[0], value = _a[1]; return theme === null || theme === void 0 ? void 0 : theme.font.sizes.desktop[type][value]; }; exports.default = getFontTheme;