diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-28 19:20:02 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-28 19:20:02 -0600 |
commit | 607203134e886f436f41d3e559042b70fec82a38 (patch) | |
tree | 759772a9d1a3adfe5942ac424bec943b4135bdb5 /src/view/lib/styles.ts | |
parent | 8f55e3149ec17dcbb39286670ff20729af1e9205 (diff) | |
download | voidsky-607203134e886f436f41d3e559042b70fec82a38.tar.zst |
Update posts in feed to use the theming system
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, + } +} |