diff options
Diffstat (limited to 'src/view/lib/styles.ts')
-rw-r--r-- | src/view/lib/styles.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/view/lib/styles.ts b/src/view/lib/styles.ts index 26d33f6cb..8933a8d8e 100644 --- a/src/view/lib/styles.ts +++ b/src/view/lib/styles.ts @@ -1,4 +1,5 @@ -import {StyleSheet} from 'react-native' +import {StyleSheet, TextStyle} from 'react-native' +import {Theme, TypographyVariant} from './ThemeContext' // 1 is lightest, 2 is light, 3 is mid, 4 is dark, 5 is darkest export const colors = { @@ -191,3 +192,13 @@ export const s = StyleSheet.create({ green4: {color: colors.green4}, green5: {color: colors.green5}, }) + +export function lh( + theme: Theme, + type: TypographyVariant, + height: number, +): TextStyle { + return { + lineHeight: (theme.typography[type].lineHeight || 16) * height, + } +} |