forked from mientjan/react-native-markdown-renderer
-
Notifications
You must be signed in to change notification settings - Fork 176
/
styles.js
192 lines (180 loc) · 3.26 KB
/
styles.js
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import {Platform} from 'react-native';
// this is converted to a stylesheet internally at run time with StyleSheet.create(
export const styles = {
// The main container
body: {},
// Headings
heading1: {
flexDirection: 'row',
fontSize: 32,
},
heading2: {
flexDirection: 'row',
fontSize: 24,
},
heading3: {
flexDirection: 'row',
fontSize: 18,
},
heading4: {
flexDirection: 'row',
fontSize: 16,
},
heading5: {
flexDirection: 'row',
fontSize: 13,
},
heading6: {
flexDirection: 'row',
fontSize: 11,
},
// Horizontal Rule
hr: {
backgroundColor: '#000000',
height: 1,
},
// Emphasis
strong: {
fontWeight: 'bold',
},
em: {
fontStyle: 'italic',
},
s: {
textDecorationLine: 'line-through',
},
// Blockquotes
blockquote: {
backgroundColor: '#F5F5F5',
borderColor: '#CCC',
borderLeftWidth: 4,
marginLeft: 5,
paddingHorizontal: 5,
},
// Lists
bullet_list: {},
ordered_list: {},
list_item: {
flexDirection: 'row',
justifyContent: 'flex-start',
},
// @pseudo class, does not have a unique render rule
bullet_list_icon: {
marginLeft: 10,
marginRight: 10,
},
// @pseudo class, does not have a unique render rule
bullet_list_content: {
flex: 1,
},
// @pseudo class, does not have a unique render rule
ordered_list_icon: {
marginLeft: 10,
marginRight: 10,
},
// @pseudo class, does not have a unique render rule
ordered_list_content: {
flex: 1,
},
// Code
code_inline: {
borderWidth: 1,
borderColor: '#CCCCCC',
backgroundColor: '#f5f5f5',
padding: 10,
borderRadius: 4,
...Platform.select({
['ios']: {
fontFamily: 'Courier',
},
['android']: {
fontFamily: 'monospace',
},
}),
},
code_block: {
borderWidth: 1,
borderColor: '#CCCCCC',
backgroundColor: '#f5f5f5',
padding: 10,
borderRadius: 4,
...Platform.select({
['ios']: {
fontFamily: 'Courier',
},
['android']: {
fontFamily: 'monospace',
},
}),
},
fence: {
borderWidth: 1,
borderColor: '#CCCCCC',
backgroundColor: '#f5f5f5',
padding: 10,
borderRadius: 4,
...Platform.select({
['ios']: {
fontFamily: 'Courier',
},
['android']: {
fontFamily: 'monospace',
},
}),
},
// Tables
table: {
borderWidth: 1,
borderColor: '#000000',
borderRadius: 3,
},
thead: {},
tbody: {},
th: {
flex: 1,
padding: 5,
},
tr: {
borderBottomWidth: 1,
borderColor: '#000000',
flexDirection: 'row',
},
td: {
flex: 1,
padding: 5,
},
// Links
link: {
textDecorationLine: 'underline',
},
blocklink: {
flex: 1,
borderColor: '#000000',
borderBottomWidth: 1,
},
// Images
image: {
flex: 1,
},
// Text Output
text: {},
textgroup: {},
paragraph: {
marginTop: 10,
marginBottom: 10,
flexWrap: 'wrap',
flexDirection: 'row',
alignItems: 'flex-start',
justifyContent: 'flex-start',
width: '100%',
},
hardbreak: {
width: '100%',
height: 1,
},
softbreak: {},
// Believe these are never used but retained for completeness
pre: {},
inline: {},
span: {},
};