Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
333 lines (280 loc) · 13.3 KB

File metadata and controls

333 lines (280 loc) · 13.3 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
import { html } from 'lit';
import ColorUtils from './color-utils';
/* Generates an schema object containing type and constraint info */
export default function setTheme(baseTheme, theme = {}) {
let newTheme = {};
// Common Theme colors
const primaryColor = theme.primaryColor ? theme.primaryColor : baseTheme === 'dark' ? '#f76b39' : '#ff591e';
const primaryColorInvert = ColorUtils.color.invert(primaryColor);
const primaryColorTrans = ColorUtils.color.opacity(primaryColor, '0.4');
// Dark and Light Theme colors
if (baseTheme === 'dark') {
const bg1 = theme.bg1 ? theme.bg1 : '#2a2b2c';
const fg1 = theme.fg1 ? theme.fg1 : '#bbb';
const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, 5); // or #383838;
const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, 17); // or #444;
const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, 35);
const fg2 = theme.fg2 ? theme.fg2 : ColorUtils.color.brightness(fg1, -15); // or #ababab
const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, -20); // or #aaa
const lightFg = theme.fg3 ? theme.fg3 : '#A1A8B3'; // or #777
const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : '#aaa';
const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, 10);
const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, 10);
const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.50');
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);
const navAccentColor = theme.navAccentColor ? theme.navAccentColor : ColorUtils.color.brightness(primaryColor, 25);
const navAccentTextColor = theme.navAccentTextColor ? theme.navAccenttextColor : ColorUtils.color.invert(navAccentColor);
const overlayBg = 'rgba(80, 80, 80, 0.4)';
newTheme = {
bg1,
bg2,
bg3,
lightBg,
fg1,
fg2,
fg3,
lightFg,
inlineCodeFg,
primaryColor,
primaryColorTrans,
primaryColorInvert,
overlayBg,
navBgColor,
navTextColor,
navHoverBgColor,
navHoverTextColor,
navAccentColor,
navAccentTextColor,
headerColor,
headerColorInvert: ColorUtils.color.invert(headerColor),
headerColorDarker: ColorUtils.color.brightness(headerColor, -20),
headerColorBorder: ColorUtils.color.brightness(headerColor, 10),
borderColor: theme.borderColor || ColorUtils.color.brightness(bg1, 20), // #555
lightBorderColor: theme.lightBorderColor || '#e7e9ee', // #444
codeBorderColor: theme.codeBorderColor || ColorUtils.color.brightness(bg1, 30),
inputBg: theme.inputBg || ColorUtils.color.brightness(bg1, -5), // #2f2f2f
placeHolder: theme.placeHolder || ColorUtils.color.opacity(fg1, '0.3'),
hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -10), // #2a2a2a
red: theme.red ? theme.red : '#F06560',
lightRed: theme.lightRed ? theme.lightRed : ColorUtils.color.brightness(bg1, -10), // #2a2a2a
pink: theme.pink ? theme.pink : '#ffb2b2',
lightPink: theme.lightPink || ColorUtils.color.brightness(bg1, -10),
vtexPink: theme.vtexPink ? theme.vtexPink : '#D71D55',
green: theme.green || '#7ec699',
lightGreen: theme.lightGreen || ColorUtils.color.brightness(bg1, -10), // #2a2a2a
blue: theme.blue || '#71b7ff',
lightBlue: theme.lightBlue || ColorUtils.color.brightness(bg1, -10), // #2a2a2a
orange: theme.orange ? theme.orange : '#f08d49',
lightOrange: theme.lightOrange || ColorUtils.color.brightness(bg1, -10), // #2a2a2a
yellow: theme.yellow || '#827717',
lightYellow: theme.lightYellow || ColorUtils.color.brightness(bg1, -10), // #2a2a2a
purple: theme.purple || '#786FF1',
brown: theme.brown || '#D4AC0D',
codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),
codeFg: theme.codeFg || '#aaa',
codePropertyColor: theme.codePropertyColor || '#f8c555',
codeKeywordColor: theme.codeKeywordColor || '#cc99cd',
codeOperatorColor: theme.codeOperatorColor || '#67cdcc',
};
} else {
const bg1 = (theme.bg1 ? theme.bg1 : '#fafbfc');
const fg1 = (theme.fg1 ? theme.fg1 : '#444444');
const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, -5); // or '#fafafa'
const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -15); // or '#f6f6f6'
const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -45);
const fg2 = theme.fg2 ? theme.fg2 : '#545454';
const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 30); // or #666
const lightFg = theme.fg3 ? theme.fg3 : '#A1A8B3'; // or #999
const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : 'brown';
const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, -180);
/*
const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -10);
const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.brightness(fg1, 5);
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : bg1;
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : primaryColor;
const navAccentColor = theme.navAccentColor ? theme.navAccentColor : primaryColor;
*/
const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -200);
const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.65');
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);
const navAccentColor = theme.navAccentColor ? theme.navAccentColor : ColorUtils.color.brightness(primaryColor, 25);
const navAccentTextColor = theme.navAccentTextColor ? theme.navAccenttextColor : ColorUtils.color.invert(navAccentColor);
const overlayBg = 'rgba(0, 0, 0, 0.4)';
newTheme = {
bg1,
bg2,
bg3,
lightBg,
fg1,
fg2,
fg3,
lightFg,
inlineCodeFg,
primaryColor,
primaryColorTrans,
primaryColorInvert,
overlayBg,
navBgColor,
navTextColor,
navHoverBgColor,
navHoverTextColor,
navAccentColor,
navAccentTextColor,
headerColor,
headerColorInvert: ColorUtils.color.invert(headerColor),
headerColorDarker: ColorUtils.color.brightness(headerColor, -20),
headerColorBorder: ColorUtils.color.brightness(headerColor, 10),
borderColor: theme.borderColor || '#B9B9B9',
lightBorderColor: theme.lightBorderColor || '#e7e9ee',
codeBorderColor: theme.codeBorderColor || 'transparent',
inputBg: theme.inputBg || 'rgba(255, 255, 255, 0.0001)',
placeHolder: theme.placeHolder || ColorUtils.color.brightness(lightFg, 20), // #dedede
hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -5), // # f1f1f1
rebelPink: '#e31c58',
red: theme.red || '#F06560',
lightRed: theme.lightRed || '#fff0f0',
pink: theme.pink ? theme.pink : '#990055',
lightPink: theme.lightPink ? theme.lightPink : '#ffb2b2',
vtexPink: theme.vtexPink ? theme.vtexPink : '#D71D55',
green: theme.green || '#690',
lightGreen: theme.lightGreen || '#fbfff0',
blue: theme.blue || '#47AFE8',
lightBlue: theme.lightBlue || '#eff8fd',
orange: theme.orange || '#FF9900',
lightOrange: theme.lightOrange || '#fff5e6',
yellow: theme.yellow || '#827717',
lightYellow: theme.lightYellow || '#fff5cc',
purple: theme.purple || '#786FF1',
brown: theme.brown || '#D4AC0D',
fgPositive: '#38853C',
bgPositive: '#DFF1E0',
borderPositive: '#83D187',
fgPatch: '#6C6314',
bgPatch: '#e9e7da',
borderPatch: '#afa871',
fgWarning: '#D56A00',
bgWarning: '#FFEBD7',
borderWarning: '#F5AE70',
fgInfo: '#2978B5',
bgInfo: '#DEECF7',
borderInfo: '#7CBBEA',
fgCritical: '#CC3D3D',
bgCritical: '#F8E3E3',
borderCritical: '#F49494',
codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),
codeFg: theme.codeFg || '#666',
codePropertyColor: theme.codePropertyColor || '#905',
codeKeywordColor: theme.codeKeywordColor || '#07a',
codeOperatorColor: theme.codeOperatorColor || '#9a6e3a',
};
}
return html`
<style>
*, *:before, *:after { box-sizing: border-box; }
:host {
/* Common Styles - irrespective of themes */
--border-radius: 4px;
--layout: ${this.layout || 'row'};
--font-mono: ${this.monoFont || 'Monaco, "Andale Mono", "Roboto Mono", Consolas, monospace'};
--font-medium: ${this.mediumFont || this.monoFont || 'Monaco, "Andale Mono", "Roboto Mono", Consolas, monospace'};
--font-regular: ${this.regularFont || '"Open Sans", Avenir, "Segoe UI", Arial, sans-serif'};
--scroll-bar-width: 8px;
--nav-item-padding: ${this.navItemSpacing === 'relaxed'
? '10px 16px 10px 10px'
: (this.navItemSpacing === 'compact'
? '5px 16px 5px 10px'
: '7px 16px 7px 10px')};
--resp-area-height: ${this.responseAreaHeight};
--font-size-small: ${this.fontSize === 'default' ? '12px' : (this.fontSize === 'large' ? '13px' : '14px')};
--font-size-mono: ${this.fontSize === 'default' ? '13px' : (this.fontSize === 'large' ? '14px' : '15px')};
--font-size-regular: ${this.fontSize === 'default' ? '16px' : (this.fontSize === 'large' ? '17px' : '18px')};
--dialog-z-index: 1000;
--focus-shadow: 0 0 0 1px transparent, 0 0 0 3px ${newTheme.primaryColorTrans};
/* Theme specific styles */
--bg:${newTheme.bg1};
--bg2:${newTheme.bg2};
--bg3:${newTheme.bg3};
--light-bg:${newTheme.lightBg};
--fg:${newTheme.fg1};
--fg2:${newTheme.fg2};
--fg3:${newTheme.fg3};
--light-fg:${newTheme.lightFg};
--overlay-bg:${newTheme.overlayBg};
/* Border Colors */
--border-color:${newTheme.borderColor};
--light-border-color:${newTheme.lightBorderColor};
--code-border-color:${newTheme.codeBorderColor};
--input-bg:${newTheme.inputBg};
--placeholder-color:${newTheme.placeHolder};
--hover-color:${newTheme.hoverColor};
--rebel-pink:${newTheme.rebelPink};
--red:${newTheme.red};
--light-red:${newTheme.lightRed};
--pink:${newTheme.pink};
--light-pink:${newTheme.lightPink};
--vtex-pink:${newTheme.vtexPink};
--green:${newTheme.green};
--light-green:${newTheme.lightGreen};
--blue:${newTheme.blue};
--light-blue:${newTheme.lightBlue};
--orange:${newTheme.orange};
--light-orange:${newTheme.lightOrange};
--yellow:${newTheme.yellow};
--light-yellow:${newTheme.lightYellow};
--purple:${newTheme.purple};
--brown:${newTheme.brown};
/* Header Color */
--header-bg:${newTheme.headerColor};
--header-fg:${newTheme.headerColorInvert};
--header-color-darker:${newTheme.headerColorDarker};
--header-color-border:${newTheme.headerColorBorder};
/* Nav Colors */
--nav-bg-color:${newTheme.navBgColor};
--nav-text-color:${newTheme.navTextColor};
--nav-hover-bg-color:${newTheme.navHoverBgColor};
--nav-hover-text-color:${newTheme.navHoverTextColor};
--nav-accent-color:${newTheme.navAccentColor};
--nav-accent-text-color:${newTheme.navAccentTextColor};
/* Nav API Method Colors*/
--nav-get-color:${newTheme.blue};
--nav-put-color:${newTheme.orange};
--nav-post-color:${newTheme.green};
--nav-delete-color:${newTheme.red};
--nav-head-color:${newTheme.yellow};
/* API Method Colors */
--get-color:${newTheme.fgPositive};
--get-bg-color:${newTheme.bgPositive};
--get-border-color:${newTheme.borderPositive};
--patch-color:${newTheme.fgPatch};
--patch-bg-color:${newTheme.bgPatch};
--patch-border-color:${newTheme.borderPatch};
--put-color:${newTheme.fgWarning};
--put-bg-color:${newTheme.bgWarning};
--put-border-color:${newTheme.borderWarning};
--post-color:${newTheme.fgInfo};
--post-bg-color:${newTheme.bgInfo};
--post-border-color:${newTheme.borderInfo};
--delete-color:${newTheme.fgCritical};
--delete-bg-color:${newTheme.bgCritical};
--delete-border-color:${newTheme.borderCritical};
/* HTTP Status Colors */
--success-color:${newTheme.fgPositive};
--informational-color:${newTheme.fgInfo};
--redirection-color:${newTheme.fgWarning};
--error-color:${newTheme.fgCritical};
/* Primary Colors */
--primary-color:${newTheme.primaryColor};
--primary-color-invert:${newTheme.primaryColorInvert};
--primary-color-trans:${newTheme.primaryColorTrans};
/*Code Syntax Color*/
--code-bg:${newTheme.codeBg};
--code-fg:${newTheme.codeFg};
--inline-code-fg:${newTheme.inlineCodeFg};
--code-property-color:${newTheme.codePropertyColor};
--code-keyword-color:${newTheme.codeKeywordColor};
--code-operator-color:${newTheme.codeOperatorColor};
}
</style>`;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.