styles.js 4.03 KB
Newer Older
1
2
3
4
5
/* @flow */
const black = '#293238',
  darkGray = '#878e91',
  red = '#ce1126',
  lightRed = '#fccfcf',
6
7
  yellow = '#fbf5b4',
  white = '#ffffff';
8
9
10

const iframeStyle = {
  position: 'fixed',
11
12
13
14
  top: '0',
  left: '0',
  width: '100%',
  height: '100%',
15
16
17
18
19
  border: 'none',
  'z-index': 1337,
};

const overlayStyle = {
20
21
  width: '100%',
  height: '100%',
22
  'box-sizing': 'border-box',
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  'text-align': 'center',
  'background-color': white,
};

const containerStyle = {
  position: 'relative',
  display: 'inline-flex',
  'flex-direction': 'column',
  height: '100%',
  width: '1024px',
  'max-width': '100%',
  'overflow-x': 'hidden',
  'overflow-y': 'auto',
  padding: '0.5rem',
  'box-sizing': 'border-box',
  'text-align': 'start',
39
  'font-family': 'Consolas, Menlo, monospace',
40
  'font-size': '11px',
41
42
43
  'white-space': 'pre-wrap',
  'word-break': 'break-word',
  'line-height': 1.5,
44
  color: black,
45
46
47
48
49
50
51
52
53
54
55
56
57
};

const hintsStyle = {
  color: darkGray,
};

const hintStyle = {
  padding: '0.5em 1em',
  cursor: 'pointer',
};

const closeButtonStyle = {
  color: black,
58
59
60
  'line-height': '1rem',
  'font-size': '1.5rem',
  padding: '1rem',
61
62
63
64
65
66
  cursor: 'pointer',
  position: 'absolute',
  right: 0,
  top: 0,
};

67
const additionalChildStyle = {
68
69
  'margin-bottom': '0.5rem',
};
70
71

const headerStyle = {
72
73
  'font-size': '2em',
  'font-family': 'sans-serif',
74
  color: red,
75
  'white-space': 'pre-wrap',
76
77
78
  // Top bottom margin spaces header
  // Right margin revents overlap with close button
  margin: '0 2rem 0.75rem 0',
79
  flex: '0 0 auto',
80
  'max-height': '50%',
81
  overflow: 'auto',
82
83
};

84
const functionNameStyle = {};
85
86
87

const linkStyle = {
  'font-size': '0.9em',
88
  'margin-bottom': '0.9em',
89
90
91
92
93
94
95
96
97
};

const anchorStyle = {
  'text-decoration': 'none',
  color: darkGray,
};

const traceStyle = {
  'font-size': '1em',
98
99
100
  flex: '0 1 auto',
  'min-height': '0px',
  overflow: 'auto',
101
102
};

103
const depStyle = {};
104
105
106
107
108
109
110
111
112

const primaryErrorStyle = {
  'background-color': lightRed,
};

const secondaryErrorStyle = {
  'background-color': yellow,
};

113
114
115
116
117
118
119
const omittedFramesCollapsedStyle = {
  color: black,
  cursor: 'pointer',
  'margin-bottom': '1.5em',
};

const omittedFramesExpandedStyle = {
120
121
  color: black,
  cursor: 'pointer',
122
  'margin-bottom': '0.6em',
123
124
};

125
const primaryPreStyle = {
126
127
  display: 'block',
  padding: '0.5em',
128
129
  'margin-top': '0.5em',
  'margin-bottom': '0.5em',
130
  'overflow-x': 'auto',
131
132
133
  'white-space': 'pre-wrap',
  'border-radius': '0.25rem',
  'background-color': 'rgba(206, 17, 38, .05)',
134
};
135
136
137
138
139
140
141
142
143
144
const secondaryPreStyle = {
  display: 'block',
  padding: '0.5em',
  'margin-top': '0.5em',
  'margin-bottom': '0.5em',
  'overflow-x': 'auto',
  'white-space': 'pre-wrap',
  'border-radius': '0.25rem',
  'background-color': 'rgba(251, 245, 180,.3)',
};
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

const toggleStyle = {
  'margin-bottom': '1.5em',
  color: darkGray,
  cursor: 'pointer',
};

const codeStyle = {
  'font-family': 'Consolas, Menlo, monospace',
};

const hiddenStyle = {
  display: 'none',
};

const groupStyle = {
161
  'margin-right': '1em',
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
};

const _groupElemStyle = {
  'background-color': 'inherit',
  'border-color': '#ddd',
  'border-width': '1px',
  'border-radius': '4px',
  'border-style': 'solid',
  padding: '3px 6px',
  cursor: 'pointer',
};

const groupElemLeft = Object.assign({}, _groupElemStyle, {
  'border-top-right-radius': '0px',
  'border-bottom-right-radius': '0px',
  'margin-right': '0px',
});

const groupElemRight = Object.assign({}, _groupElemStyle, {
  'border-top-left-radius': '0px',
  'border-bottom-left-radius': '0px',
183
  'margin-right': '-1px',
184
185
186
});

const footerStyle = {
187
  'font-family': 'sans-serif',
188
  color: darkGray,
189
190
  'margin-top': '0.5rem',
  flex: '0 0 auto',
191
192
193
};

export {
194
  containerStyle,
195
196
197
198
199
  iframeStyle,
  overlayStyle,
  hintsStyle,
  hintStyle,
  closeButtonStyle,
200
  additionalChildStyle,
201
202
203
204
205
206
207
  headerStyle,
  functionNameStyle,
  linkStyle,
  anchorStyle,
  traceStyle,
  depStyle,
  primaryErrorStyle,
208
  primaryPreStyle,
209
  secondaryErrorStyle,
210
211
212
  secondaryPreStyle,
  omittedFramesCollapsedStyle,
  omittedFramesExpandedStyle,
213
214
215
216
217
218
219
220
  toggleStyle,
  codeStyle,
  hiddenStyle,
  groupStyle,
  groupElemLeft,
  groupElemRight,
  footerStyle,
};