styles.js 3.99 KB
Newer Older
1
2
3
4
/* @flow */
const black = '#293238',
  darkGray = '#878e91',
  red = '#ce1126',
5
  redTransparent = 'rgba(206, 17, 38, 0.05)',
6
  lightRed = '#fccfcf',
7
  yellow = '#fbf5b4',
8
  yellowTransparent = 'rgba(251, 245, 180, 0.3)',
9
  white = '#ffffff';
10
11
12

const iframeStyle = {
  position: 'fixed',
13
14
15
16
  top: '0',
  left: '0',
  width: '100%',
  height: '100%',
17
  border: 'none',
18
  'z-index': 2147483647 - 1, // below the compile error overlay
19
20
21
};

const overlayStyle = {
22
23
  width: '100%',
  height: '100%',
24
  'box-sizing': 'border-box',
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  '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',
40
  'text-align': 'left',
41
  'font-family': 'Consolas, Menlo, monospace',
42
  'font-size': '11px',
43
44
45
  'white-space': 'pre-wrap',
  'word-break': 'break-word',
  'line-height': 1.5,
46
  color: black,
47
48
49
50
51
52
53
54
55
56
57
58
59
};

const hintsStyle = {
  color: darkGray,
};

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

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

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

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

86
const functionNameStyle = {};
87
88
89

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

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

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

105
const depStyle = {};
106
107
108
109
110
111
112
113
114

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

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

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

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

127
const _preStyle = {
128
129
  display: 'block',
  padding: '0.5em',
130
131
  'margin-top': '0.5em',
  'margin-bottom': '0.5em',
132
  'overflow-x': 'auto',
133
134
  'white-space': 'pre-wrap',
  'border-radius': '0.25rem',
135
};
136
137
138
139
140
141
const primaryPreStyle = Object.assign({}, _preStyle, {
  'background-color': redTransparent,
});
const secondaryPreStyle = Object.assign({}, _preStyle, {
  'background-color': yellowTransparent,
});
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

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

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

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

const groupStyle = {
158
  'margin-right': '1em',
159
160
161
};

const _groupElemStyle = {
162
163
164
  'background-color': redTransparent,
  color: red,
  border: 'none',
165
166
167
168
169
170
171
172
  'border-radius': '4px',
  padding: '3px 6px',
  cursor: 'pointer',
};

const groupElemLeft = Object.assign({}, _groupElemStyle, {
  'border-top-right-radius': '0px',
  'border-bottom-right-radius': '0px',
173
  'margin-right': '1px',
174
175
176
177
178
179
180
181
});

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

const footerStyle = {
182
  'font-family': 'sans-serif',
183
  color: darkGray,
184
185
  'margin-top': '0.5rem',
  flex: '0 0 auto',
186
187
188
};

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