Repository navigation
Expand file tree
/
Copy pathtypography.ts
More file actions
147 lines (141 loc) · 3.35 KB
/
Copy pathtypography.ts
File metadata and controls
147 lines (141 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import { Platform } from 'react-native';
import colors from './colors';
type textprops = {
fontFamily: string,
color: string,
fontSize: number,
fontStyle: "normal" | "italic",
fontWeight: number | string,
};
export type Typography = {
/**
* Title is reserved for the title of a screen(Toolbar)
* and the titles of Modal dialogs.
*/
titleText: textprops,
titleTextBold: textprops,
/**
* Use the Heading style for card titles.
*/
headingText: textprops,
headingTextBold: textprops,
/**
* Use the Subheading style to denote new sections within cards.
*/
subheadingText: textprops,
subheadingTextBold: textprops,
/**
* The Body text style is used widely throughout the UI.
* Any text that isn’t a title, heading, subheading, label
* or caption would generally use the Body style.
*/
bodyText: textprops,
bodyTextBold: textprops,
/**
* Use labels with form field and input elements to
* signify the element’s function to the user.
*/
labelText: textprops,
labelTextBold: textprops,
/**
* Use the Caption style for help/hint text.
* It’s used with some form fields which require a description,
* and can also be used stand-alone within a card when necessary.
*/
captionText: textprops,
captionTextBold: textprops,
};
const fontFamily = Platform.select({ android: 'sans-serif', ios: 'Helvetica' });
const fontWeightRegular = 'normal';
const fontWeightBold = 'bold';
const appbarTitleTextColor = colors.appbarTint;
const titleTextColor = colors.titleText;
const bodyTextColor = colors.bodyText;
const captionTextColor = colors.captionText;
const typography: Typography = {
titleText: {
fontFamily,
color: appbarTitleTextColor,
fontSize: 20,
fontStyle: 'normal',
fontWeight: fontWeightRegular,
},
titleTextBold: {
fontFamily,
color: appbarTitleTextColor,
fontSize: 20,
fontStyle: 'normal',
fontWeight: fontWeightBold,
},
headingText: {
fontFamily,
color: titleTextColor,
fontSize: 20,
fontStyle: 'normal',
fontWeight: fontWeightRegular,
},
headingTextBold: {
fontFamily,
color: titleTextColor,
fontSize: 20,
fontStyle: 'normal',
fontWeight: fontWeightBold,
},
subheadingText: {
fontFamily,
color: titleTextColor,
fontSize: 18,
fontStyle: 'normal',
fontWeight: fontWeightRegular,
},
subheadingTextBold: {
fontFamily,
color: titleTextColor,
fontSize: 18,
fontStyle: 'normal',
fontWeight: fontWeightBold,
},
bodyText: {
fontFamily,
color: bodyTextColor,
fontSize: 16,
fontStyle: 'normal',
fontWeight: fontWeightRegular,
},
bodyTextBold: {
fontFamily,
color: bodyTextColor,
fontSize: 16,
fontStyle: 'normal',
fontWeight: fontWeightBold,
},
labelText: {
fontFamily,
color: titleTextColor,
fontSize: 16,
fontStyle: 'normal',
fontWeight: fontWeightRegular,
},
labelTextBold: {
fontFamily,
color: titleTextColor,
fontSize: 16,
fontStyle: 'normal',
fontWeight: fontWeightBold,
},
captionText: {
fontFamily,
color: captionTextColor,
fontSize: 14,
fontStyle: 'normal',
fontWeight: fontWeightRegular,
},
captionTextBold: {
fontFamily,
color: captionTextColor,
fontSize: 14,
fontStyle: 'normal',
fontWeight: fontWeightBold,
},
};
export default typography;