npm install @qnpm/q-theme --save --registry=http://npmrepo.corp.qunar.com
所有尺寸相关数据,
Theme
中都会默认导致两份数据(一份已缩放数据、一份未缩放数据),具体格式如果:
const size: MultiVariant<IFontSize> = { unscaled: fontSizeUnscaled, scaled: fontSizeScaled };
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import Theme, { Icon } from '@qnpm/q-theme';
const { font } = Theme;
export default class Demo extends Component {
render() {
return (
<View>
<Icon name='share' />
<Text style={{
fontSize: font.size.scaled.fontSizeS,
lineHeight: font.lineHeight.scaled.lineHeightN10,
fontWeight: font.weight.fontWeightBold,
fontFamily: font.family.EnglishFontFamilyRegular
}}>q-theme</Text>
</View>
);
}
}