-
Notifications
You must be signed in to change notification settings - Fork 255
/
presets.ts
141 lines (139 loc) · 2.63 KB
/
presets.ts
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
/**
* Pre-defined styles for elements. Here we hand pick some from Chromium's
* default styles:
* https://chromium.googlesource.com/chromium/blink/ /master/Source/core/css/html.css
*
* We try to only include commonly used, styling elements rather than semantic elements.
*/
const DEFAULT_DISPLAY = 'flex'
export default {
// Generic block-level elements
p: {
display: DEFAULT_DISPLAY,
marginTop: '1em',
marginBottom: '1em',
},
div: {
display: DEFAULT_DISPLAY,
},
blockquote: {
display: DEFAULT_DISPLAY,
marginTop: '1em',
marginBottom: '1em',
marginLeft: 40,
marginRight: 40,
},
center: {
display: DEFAULT_DISPLAY,
textAlign: 'center',
},
hr: {
display: DEFAULT_DISPLAY,
marginTop: '0.5em',
marginBottom: '0.5em',
marginLeft: 'auto',
marginRight: 'auto',
borderWidth: 1,
// We don't have `inset`
borderStyle: 'solid',
},
// Heading elements
h1: {
display: DEFAULT_DISPLAY,
fontSize: '2em',
marginTop: '0.67em',
marginBottom: '0.67em',
marginLeft: 0,
marginRight: 0,
fontWeight: 'bold',
},
h2: {
display: DEFAULT_DISPLAY,
fontSize: '1.5em',
marginTop: '0.83em',
marginBottom: '0.83em',
marginLeft: 0,
marginRight: 0,
fontWeight: 'bold',
},
h3: {
display: DEFAULT_DISPLAY,
fontSize: '1.17em',
marginTop: '1em',
marginBottom: '1em',
marginLeft: 0,
marginRight: 0,
fontWeight: 'bold',
},
h4: {
display: DEFAULT_DISPLAY,
marginTop: '1.33em',
marginBottom: '1.33em',
marginLeft: 0,
marginRight: 0,
fontWeight: 'bold',
},
h5: {
display: DEFAULT_DISPLAY,
fontSize: '0.83em',
marginTop: '1.67em',
marginBottom: '1.67em',
marginLeft: 0,
marginRight: 0,
fontWeight: 'bold',
},
h6: {
display: DEFAULT_DISPLAY,
fontSize: '0.67em',
marginTop: '2.33em',
marginBottom: '2.33em',
marginLeft: 0,
marginRight: 0,
fontWeight: 'bold',
},
// Tables
// Lists
// Form elements
// Inline elements
u: {
textDecoration: 'underline',
},
strong: {
fontWeight: 'bold',
},
b: {
fontWeight: 'bold',
},
i: {
fontStyle: 'italic',
},
em: {
fontStyle: 'italic',
},
code: {
fontFamily: 'monospace',
},
kbd: {
fontFamily: 'monospace',
},
pre: {
display: DEFAULT_DISPLAY,
fontFamily: 'monospace',
whiteSpace: 'pre',
marginTop: '1em',
marginBottom: '1em',
},
mark: {
backgroundColor: 'yellow',
color: 'black',
},
big: {
fontSize: 'larger',
},
small: {
fontSize: 'smaller',
},
s: {
textDecoration: 'line-through',
},
}