mirror of
https://github.com/tooot-app/app
synced 2025-02-18 04:40:57 +01:00
Try to fix font size too small on large screen
This commit is contained in:
parent
6b048e4b2a
commit
f127fc3a1a
@ -1,15 +1,31 @@
|
||||
import { Dimensions } from 'react-native'
|
||||
|
||||
const { width, height } = Dimensions.get('screen')
|
||||
|
||||
const guidelineBaseWidth = 375
|
||||
const guidelineBaseHeight = 667
|
||||
|
||||
const scale = (size: number) => (width / guidelineBaseWidth) * size
|
||||
const verticalScale = (size: number) => (height / guidelineBaseHeight) * size
|
||||
const moderateScale = (size: number, factor = 0.5) =>
|
||||
size + (scale(size) - size) * factor
|
||||
|
||||
const Base = 4
|
||||
|
||||
export const StyleConstants = {
|
||||
Font: {
|
||||
Size: { S: 14, M: 16, L: 18 },
|
||||
LineHeight: { S: 20, M: 22, L: 30 },
|
||||
Size: { S: moderateScale(14), M: moderateScale(16), L: moderateScale(18) },
|
||||
LineHeight: {
|
||||
S: moderateScale(20),
|
||||
M: moderateScale(22),
|
||||
L: moderateScale(30)
|
||||
},
|
||||
Weight: { Normal: '400' as '400', Bold: '600' as '600' }
|
||||
},
|
||||
FontStyle: {
|
||||
S: { fontSize: 14, lineHeight: 20 },
|
||||
M: { fontSize: 16, lineHeight: 22 },
|
||||
L: { fontSize: 20, lineHeight: 30 }
|
||||
S: { fontSize: moderateScale(14), lineHeight: moderateScale(20) },
|
||||
M: { fontSize: moderateScale(16), lineHeight: moderateScale(22) },
|
||||
L: { fontSize: moderateScale(20), lineHeight: moderateScale(30) }
|
||||
},
|
||||
|
||||
Spacing: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user