@bothub-chat/ui
Version:
Bothub UI Components
2 lines (1 loc) • 836 B
JavaScript
const a=a=>{"decl"===a.type&&"background"!==a.props&&"background-image"!==a.props&&(a.value=a.value.replace(/([-0-9.]+)px/g,((a,e)=>{const c=+e;return Math.abs(c)<=1?`${c}px`:`calc(var(--bothub-scale, 1) * ${c}px)`})),a.value=a.value.replace(/([-0-9.]+)vh/g,((a,e)=>`calc(var(--bothub-vh, 1vh) * ${+e})`)))},e=a=>{"decl"===a.type&&"background"!==a.props&&"background-image"!==a.props&&(a.value=a.value.replace(/([-0-9.]+)px/g,((e,c)=>{const p=+c;return Math.abs(p)<=1?`${p}px`:"font-size"===a.props?`max(calc(var(--bothub-scale, 1) * ${p}px), 12px)`:"line-height"===a.props?`max(calc(var(--bothub-scale, 1) * ${p}px), 16px)`:`calc(var(--bothub-scale, 1) * ${p}px)`})),a.value=a.value.replace(/([-0-9.]+)vh/g,((a,e)=>`calc(var(--bothub-vh, 1vh) * ${+e})`)))};export{a as BothubStyleSheetDashboardPlugin,e as BothubStyleSheetMainPlugin};