styles.js 3.5 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 additionalStyle = {};
68
69

const headerStyle = {
70
71
  'font-size': '2em',
  'font-family': 'sans-serif',
72
  color: red,
73
  'white-space': 'pre-wrap',
74
75
76
77
  margin: '0.75rem 2rem 0 0', // Prevent overlap with close button
  flex: '0 0 auto',
  'max-height': '35%',
  overflow: 'auto',
78
79
80
81
82
83
84
85
};

const functionNameStyle = {
  'margin-top': '1em',
};

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

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

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

101
const depStyle = {};
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

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

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

const omittedFramesStyle = {
  color: black,
  cursor: 'pointer',
};

const preStyle = {
  display: 'block',
  padding: '0.5em',
119
120
  'margin-top': '0.5em',
  'margin-bottom': '0.5em',
121
  'overflow-x': 'auto',
122
123
124
  'white-space': 'pre-wrap',
  'border-radius': '0.25rem',
  'background-color': 'rgba(206, 17, 38, .05)',
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
};

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

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

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

const groupStyle = {
142
  'margin-right': '1em',
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
};

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',
164
  'margin-right': '-1px',
165
166
167
});

const footerStyle = {
168
  'font-family': 'sans-serif',
169
  color: darkGray,
170
171
  'margin-top': '0.5rem',
  flex: '0 0 auto',
172
173
174
};

export {
175
  containerStyle,
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
  iframeStyle,
  overlayStyle,
  hintsStyle,
  hintStyle,
  closeButtonStyle,
  additionalStyle,
  headerStyle,
  functionNameStyle,
  linkStyle,
  anchorStyle,
  traceStyle,
  depStyle,
  primaryErrorStyle,
  secondaryErrorStyle,
  omittedFramesStyle,
  preStyle,
  toggleStyle,
  codeStyle,
  hiddenStyle,
  groupStyle,
  groupElemLeft,
  groupElemRight,
  footerStyle,
};