123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- // @flow
- import color from 'color';
- import { Platform, Dimensions, PixelRatio } from 'react-native';
- import { PLATFORM } from './commonColor';
- const deviceHeight = Dimensions.get('window').height;
- const deviceWidth = Dimensions.get('window').width;
- const platform = Platform.OS;
- const platformStyle = PLATFORM.MATERIAL;
- const isIphoneX =
- platform === PLATFORM.IOS &&
- (deviceHeight === 812 ||
- deviceWidth === 812 ||
- deviceHeight === 896 ||
- deviceWidth === 896);
- export default {
- platformStyle,
- platform,
- // Accordion
- headerStyle: '#edebed',
- iconStyle: '#000',
- contentStyle: '#f5f4f5',
- expandedIconStyle: '#000',
- accordionBorderColor: '#d3d3d3',
- // ActionSheet
- elevation: 4,
- containerTouchableBackgroundColor: 'rgba(0,0,0,0.4)',
- innerTouchableBackgroundColor: '#fff',
- listItemHeight: 50,
- listItemBorderColor: 'transparent',
- marginHorizontal: -15,
- marginLeft: 14,
- marginTop: 15,
- minHeight: 56,
- padding: 15,
- touchableTextColor: '#757575',
- // Android
- androidRipple: true,
- androidRippleColor: 'rgba(256, 256, 256, 0.3)',
- androidRippleColorDark: 'rgba(0, 0, 0, 0.15)',
- buttonUppercaseAndroidText: true,
- // Badge
- badgeBg: '#ED1727',
- badgeColor: '#fff',
- badgePadding: 0,
- // Button
- buttonFontFamily: 'Roboto',
- buttonDisabledBg: '#b5b5b5',
- buttonPadding: 6,
- get buttonPrimaryBg() {
- return this.brandPrimary;
- },
- get buttonPrimaryColor() {
- return this.inverseTextColor;
- },
- get buttonInfoBg() {
- return this.brandInfo;
- },
- get buttonInfoColor() {
- return this.inverseTextColor;
- },
- get buttonSuccessBg() {
- return this.brandSuccess;
- },
- get buttonSuccessColor() {
- return this.inverseTextColor;
- },
- get buttonDangerBg() {
- return this.brandDanger;
- },
- get buttonDangerColor() {
- return this.inverseTextColor;
- },
- get buttonWarningBg() {
- return this.brandWarning;
- },
- get buttonWarningColor() {
- return this.inverseTextColor;
- },
- get buttonTextSize() {
- return this.fontSizeBase - 1;
- },
- get buttonTextSizeLarge() {
- return this.fontSizeBase * 1.5;
- },
- get buttonTextSizeSmall() {
- return this.fontSizeBase * 0.8;
- },
- get borderRadiusLarge() {
- return this.fontSizeBase * 3.8;
- },
- get iconSizeLarge() {
- return this.iconFontSize * 1.5;
- },
- get iconSizeSmall() {
- return this.iconFontSize * 0.6;
- },
- // Card
- cardDefaultBg: '#fff',
- cardBorderColor: '#ccc',
- cardBorderRadius: 2,
- cardItemPadding: platform === PLATFORM.IOS ? 10 : 12,
- // CheckBox
- CheckboxRadius: 0,
- CheckboxBorderWidth: 2,
- CheckboxPaddingLeft: 2,
- CheckboxPaddingBottom: 5,
- CheckboxIconSize: 16,
- CheckboxIconMarginTop: 1,
- CheckboxFontSize: 17,
- checkboxBgColor: '#039BE5',
- checkboxSize: 20,
- checkboxTickColor: '#fff',
- // Color
- brandPrimary: '#3F51B5',
- brandInfo: '#62B1F6',
- brandSuccess: '#5cb85c',
- brandDanger: '#d9534f',
- brandWarning: '#f0ad4e',
- brandDark: '#000',
- brandLight: '#f4f4f4',
- // Container
- containerBgColor: '#fff',
- // Date Picker
- datePickerTextColor: '#000',
- datePickerBg: 'transparent',
- // FAB
- fabWidth: 56,
- // Font
- DefaultFontSize: 16,
- fontFamily: 'Roboto',
- fontSizeBase: 15,
- get fontSizeH1() {
- return this.fontSizeBase * 1.8;
- },
- get fontSizeH2() {
- return this.fontSizeBase * 1.6;
- },
- get fontSizeH3() {
- return this.fontSizeBase * 1.4;
- },
- // Footer
- footerHeight: 55,
- footerDefaultBg: '#3F51B5',
- footerPaddingBottom: 0,
- // FooterTab
- tabBarTextColor: '#bfc6ea',
- tabBarTextSize: 11,
- activeTab: '#fff',
- sTabBarActiveTextColor: '#007aff',
- tabBarActiveTextColor: '#fff',
- tabActiveBgColor: '#3F51B5',
- // Header
- toolbarBtnColor: '#fff',
- toolbarDefaultBg: '#3F51B5',
- toolbarHeight: 56,
- toolbarSearchIconSize: 23,
- toolbarInputColor: '#fff',
- searchBarHeight: platform === PLATFORM.IOS ? 30 : 40,
- searchBarInputHeight: platform === PLATFORM.IOS ? 40 : 50,
- toolbarBtnTextColor: '#fff',
- toolbarDefaultBorder: '#3F51B5',
- iosStatusbar: 'light-content',
- get statusBarColor() {
- return color(this.toolbarDefaultBg)
- .darken(0.2)
- .hex();
- },
- get darkenHeader() {
- return color(this.tabBgColor)
- .darken(0.03)
- .hex();
- },
- // Icon
- iconFamily: 'Ionicons',
- iconFontSize: 28,
- iconHeaderSize: 24,
- // InputGroup
- inputFontSize: 17,
- inputBorderColor: '#D9D5DC',
- inputSuccessBorderColor: '#2b8339',
- inputErrorBorderColor: '#ed2f2f',
- inputHeightBase: 50,
- get inputColor() {
- return this.textColor;
- },
- get inputColorPlaceholder() {
- return '#575757';
- },
- // Line Height
- buttonLineHeight: 19,
- lineHeightH1: 32,
- lineHeightH2: 27,
- lineHeightH3: 22,
- lineHeight: 24,
- // List
- listBg: 'transparent',
- listBorderColor: '#c9c9c9',
- listDividerBg: '#f4f4f4',
- listBtnUnderlayColor: '#DDD',
- listItemPadding: 12,
- listNoteColor: '#808080',
- listNoteSize: 13,
- listItemSelected: '#3F51B5',
- // Progress Bar
- defaultProgressColor: '#E4202D',
- inverseProgressColor: '#1A191B',
- // Radio Button
- radioBtnSize: 23,
- radioSelectedColorAndroid: '#3F51B5',
- radioBtnLineHeight: 24,
- get radioColor() {
- return this.brandPrimary;
- },
- // Segment
- segmentBackgroundColor: '#3F51B5',
- segmentActiveBackgroundColor: '#fff',
- segmentTextColor: '#fff',
- segmentActiveTextColor: '#3F51B5',
- segmentBorderColor: '#fff',
- segmentBorderColorMain: '#3F51B5',
- // Spinner
- defaultSpinnerColor: '#45D56E',
- inverseSpinnerColor: '#1A191B',
- // Tab
- tabDefaultBg: '#3F51B5',
- topTabBarTextColor: '#b3c7f9',
- topTabBarActiveTextColor: '#fff',
- topTabBarBorderColor: '#fff',
- topTabBarActiveBorderColor: '#fff',
- // Tabs
- tabBgColor: '#F8F8F8',
- tabFontSize: 15,
- // Text
- textColor: '#000',
- inverseTextColor: '#fff',
- noteFontSize: 14,
- get defaultTextColor() {
- return this.textColor;
- },
- // Title
- titleFontfamily: 'Roboto',
- titleFontSize: 19,
- subTitleFontSize: 14,
- subtitleColor: '#FFF',
- titleFontColor: '#FFF',
- // Other
- borderRadiusBase: 2,
- borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
- contentPadding: 10,
- dropdownLinkColor: '#414142',
- inputLineHeight: 24,
- deviceWidth,
- deviceHeight,
- isIphoneX,
- inputGroupRoundedBorderRadius: 30,
- // iPhoneX SafeArea
- Inset: {
- portrait: {
- topInset: 24,
- leftInset: 0,
- rightInset: 0,
- bottomInset: 34
- },
- landscape: {
- topInset: 0,
- leftInset: 44,
- rightInset: 44,
- bottomInset: 21
- }
- }
- };
|