File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ import spacing from "./spacing";
3
3
import colors , { type ColorsPropType } from "./colors" ;
4
4
import type { MarkedStyles , UserTheme } from "./types" ;
5
5
6
- const getFontStyles = ( mdColors : ColorsPropType ) => {
6
+ const getFontStyles = ( mdColors : ColorsPropType , fontFamily ?: string ) => {
7
7
return StyleSheet . create ( {
8
8
regular : {
9
+ fontFamily : fontFamily ,
9
10
fontSize : 16 ,
10
11
lineHeight : 24 ,
11
12
color : mdColors . text ,
12
13
} ,
13
14
heading : {
15
+ fontFamily : fontFamily ,
14
16
fontWeight : "500" ,
15
17
color : mdColors . text ,
16
18
} ,
@@ -25,7 +27,7 @@ const getStyles = (
25
27
const mdColors = { ...colors [ colorScheme || "light" ] , ...userTheme ?. colors } ;
26
28
const mdSpacing = { ...spacing , ...userTheme ?. spacing } ;
27
29
28
- const fontStyle = getFontStyles ( mdColors ) ;
30
+ const fontStyle = getFontStyles ( mdColors , userTheme ?. fontFamily ) ;
29
31
const defaultStyles = StyleSheet . create < MarkedStyles > ( {
30
32
em : {
31
33
...fontStyle . regular ,
@@ -59,6 +61,7 @@ const getStyles = (
59
61
opacity : 0.8 ,
60
62
} ,
61
63
h1 : {
64
+ fontFamily : userTheme ?. fontFamily ,
62
65
fontSize : 32 ,
63
66
lineHeight : 40 ,
64
67
fontWeight : "bold" ,
Original file line number Diff line number Diff line change @@ -30,4 +30,5 @@ export interface MarkedStyles {
30
30
export interface UserTheme {
31
31
colors ?: Record < ColorKeysType , string > ;
32
32
spacing ?: Record < SpacingKeysType , number > ;
33
+ fontFamily ?: string | undefined ;
33
34
}
You can’t perform that action at this time.
0 commit comments