UNPKG

weex-nuke

Version:

基于 Rax 、Weex 的高性能组件体系 ~~

59 lines (55 loc) 1.61 kB
import { isWeex } from 'nuke-env'; import { rem } from 'nuke-helper'; import VariableMix from './variable'; function styleProvider(theme = {}) { const Variables = VariableMix(theme); const core = theme.Core; return { Badge: { wrap: { alignSelf: 'center', backgroundColor: Variables['normal-bg-color'], justifyContent: 'center', alignItems: 'center', }, 'auto-container': { flexDirection: 'row', overflow: 'hidden', }, 'auto-chindren': { paddingTop: Variables['auto-padding'], paddingRight: Variables['auto-padding'], }, 'auto-dot': { position: 'absolute', right: 0, top: 0, }, span: { alignSelf: 'center', }, 'dot-span': { width: rem.caculateRemToPx(Variables['dot-size']), height: rem.caculateRemToPx(Variables['dot-size']), borderRadius: 999, textAlign: 'center', }, 'number-span': { color: Variables['number-color'], height: rem.caculateRemToPx(Variables['number-size']), minWidth: rem.caculateRemToPx(Variables['number-size']), 'line-height': Variables['number-size'], // hack for h5 ...core.padding(0, Variables['number-padding']), fontSize: Variables['number-size-text'], borderRadius: Variables['number-border-radius'], }, 'unread-span': { backgroundColor: Variables['unread-bg-color'], }, 'standalone-span': { position: 'static', }, }, }; } module.exports = styleProvider;