-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expand file tree
/
Copy pathsandpack.css
More file actions
330 lines (304 loc) · 8.24 KB
/
sandpack.css
File metadata and controls
330 lines (304 loc) · 8.24 KB
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
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
html .sp-wrapper {
color-scheme: inherit;
/* palette */
--sp-colors-fg-active: #24292e !important;
--sp-colors-fg-default: #959da5 !important;
--sp-colors-fg-inactive: #e4e7eb !important;
--sp-colors-bg-active: #e4e7eb !important;
--sp-colors-bg-default: #ffffff !important;
--sp-colors-bg-default-overlay: #ffffff !important;
--sp-colors-bg-input: #ffffff !important;
--sp-colors-accent: #c8c8fa !important;
--sp-colors-bg-error: #ffcdca !important;
--sp-colors-fg-error: #811e18 !important;
/* syntax */
--theme-plain: #24292e;
--theme-comment: #6a737d;
--theme-keyword: #d73a49;
--theme-tag: #22863a;
--theme-punctuation: #24292e;
--theme-definition: #6f42c1;
--theme-property: #005cc5;
--theme-static: #032f62;
--theme-string: #032f62;
}
html.dark .sp-wrapper {
--sp-colors-fg-active: #ffffff !important;
--sp-colors-fg-default: #999999 !important;
--sp-colors-fg-inactive: #343434 !important;
--sp-colors-bg-active: #343434 !important;
--sp-colors-bg-default: #16181d !important;
--sp-colors-bg-default-overlay: #16181d !important;
--sp-colors-bg-input: #242424 !important;
--sp-colors-accent: #6caedd !important;
--sp-colors-bg-error: #ffcdca !important;
--sp-colors-fg-error: #811e18 !important;
/* syntax */
--theme-plain: #ffffff;
--theme-comment: #757575;
--theme-keyword: #77b7d7;
--theme-tag: #dfab5c;
--theme-punctuation: #ffffff;
--theme-definition: #86d9ca;
--theme-property: #77b7d7;
--theme-static: #c64640;
--theme-string: #977cdc;
}
.sp-tabs,
.sp-tab-button:hover {
background: none !important;
}
.sp-tabs .sp-tab-button {
color: #087ea4;
padding: 0 4px;
}
html.dark .sp-tabs .sp-tab-button {
color: #149eca;
}
.sp-tabs .sp-tab-button:hover {
color: #087ea4;
}
html.dark .sp-tabs .sp-tab-button:hover {
color: #149eca;
}
.sp-tabs .sp-tab-button[data-active='true'] {
color: #087ea4;
border-bottom: 2px solid #087ea4;
}
html.dark .sp-tabs .sp-tab-button[data-active='true'] {
color: #149eca;
border-bottom: 2px solid #149eca;
}
.sp-stack .sp-code-editor,
.sp-tabs .sp-tabs-scrollable-container {
overflow: hidden;
}
.sp-code-editor .cm-errorLine {
background-color: rgba(255, 107, 99, 0.1);
position: relative;
padding-right: 2em !important;
display: inline-block;
min-width: 100%;
}
.sp-code-editor .cm-errorLine:after {
position: absolute;
right: 8px;
top: 0;
content: '\26A0';
font-size: 22px;
line-height: 20px;
color: #ff3d3d;
}
.sp-code-editor .cm-tooltip {
border: 0;
max-width: 200px;
}
html.dark .sp-code-editor .cm-diagnostic {
color: var(--sp-colors-bg-default);
}
.sp-code-editor .cm-diagnostic-error {
@apply border-red-40;
}
.sp-code-editor .cm-diagnostic-warning {
border-left: 5px solid orange;
}
/*
* These are manually adjusted to match the final
* rendered version without any layout shifts.
* Note this affects both sandboxes and code blocks.
*
* There are probably more maintainable ways to do this.
* However, as long as there are kind people paying close
* attention to these subtler details, I shall sleep in peace.
*
* If you know a better way to keep them from diverging, send a PR.
*/
.sp-cm {
-webkit-text-size-adjust: none !important;
padding: 0 !important;
}
.cm-wrap {
background: transparent !important;
}
.sp-pre-placeholder {
display: block !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
padding: 18px var(--sp-space-3) !important;
@apply font-mono !important;
font-size: 13.6px !important;
line-height: 24px !important;
height: 100%;
}
.text-xl .sp-pre-placeholder {
font-size: 16px !important;
line-height: 24px !important;
}
.sp-cm .cm-scroller {
overflow: auto !important;
padding: 18px 0 !important;
}
.console .sp-cm,
.console .sp-cm .cm-scroller,
.console .sp-cm .cm-line {
padding: 0px !important;
}
.sp-cm .cm-gutters {
background-color: var(--sp-colors-bg-default);
z-index: 1;
}
.sp-wrapper {
width: 100% !important;
}
.sp-wrapper .sp-custom-layout {
overflow: initial;
border: 0px solid transparent;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
}
.sp-wrapper .sp-layout-devtools {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
html.dark .sp-layout > :not(:first-child) {
border-color: #343a46;
}
html.dark .sp-layout {
background-color: #343a46;
}
html .sp-loading {
background-color: transparent;
}
html.dark .sp-loading {
background-color: #23272f;
}
@media (min-width: 768px) {
.sp-tabs .sp-tab-button {
margin: 0 12px 0 0;
}
}
/* Devtools */
.sp-devtools {
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
overflow: hidden;
}
.sp-devtools > div {
--color-background: var(--sp-colors-bg-default) !important;
--color-background-inactive: var(--sp-colors-fg-inactive) !important;
--color-background-selected: #087ea4 !important;
--color-background-hover: transparent !important;
--color-modal-background: #ffffffd2 !important;
--color-tab-selected-border: #087ea4 !important;
--color-component-name: var(--theme-definition) !important;
--color-attribute-name: var(--theme-property) !important;
--color-attribute-value: var(--theme-string) !important;
--color-attribute-editable-value: var(--theme-property) !important;
--color-attribute-name-not-editable: var(--sp-colors-fg-default) !important;
--color-button-background-focus: var(--sp-colors-fg-inactive) !important;
--color-button-active: #087ea4 !important;
--color-button-background: transparent !important;
--color-button: var(--sp-colors-fg-default) !important;
--color-button-hover: var(--sp-colors-fg-active) !important;
--color-border: var(--sp-colors-fg-inactive) !important;
--color-text: rgb(35, 39, 47) !important;
}
html.dark .sp-devtools > div {
--color-text: var(--sp-colors-fg-default) !important;
--color-modal-background: #16181de0 !important;
}
.sp-devtools table td {
border: 1px solid var(--sp-colors-fg-inactive);
}
/* Make focus rings work */
.sp-tab-button {
transition: none !important;
}
.sp-tab-button:focus {
outline: revert !important;
}
.sp-tab-button:focus-visible {
box-shadow: none !important;
}
.sp-cm:focus-visible {
box-shadow: inset 0 0 0 4px rgba(20, 158, 202, 0.4) !important;
}
.cm-line {
padding: 0 var(--sp-space-3) !important;
}
.cm-lineNumbers {
padding-left: var(--sp-space-1) !important;
padding-right: var(--sp-space-1) !important;
}
/* For iOS: prevent browser zoom when clicking on sandbox. */
@media screen and (max-width: 768px) {
@supports (-webkit-overflow-scrolling: touch) {
.cm-content {
font-size: initial;
}
.DocSearch-Input {
font-size: initial;
}
}
}
.sp-cm {
padding-left: 8px !important;
}
.sp-layout {
min-height: 216px;
}
.sp-layout > .sp-stack:nth-child(1) {
/* Force vertical if there isn't enough space. */
min-width: 431px;
/* No min height on mobile because we know code in advance. */
/* Max height is needed to avoid too long files. */
max-height: 40vh;
}
.sp-layout > .sp-stack:nth-child(2) {
/* Force vertical if there isn't enough space. */
min-width: 431px;
/* Keep preview a fixed size on mobile to avoid jumps. */
/* This is because we don't know its content in advance. */
min-height: 40vh;
max-height: 40vh;
}
.sp-layout.sp-layout-expanded > .sp-stack:nth-child(1) {
/* Clicking "show more" lets mobile editor go full height. */
max-height: unset;
height: auto;
}
.sp-layout.sp-layout-expanded > .sp-stack:nth-child(2) {
/* Clicking "show more" lets mobile preview go full height. */
max-height: unset;
height: auto;
}
@media (min-width: 1280px) {
.sp-layout > .sp-stack:nth-child(1) {
/* On desktop, clamp height by pixels instead. */
height: auto;
min-height: unset;
max-height: 406px;
}
.sp-layout > .sp-stack:nth-child(2) {
/* On desktop, clamp height by pixels instead. */
height: auto;
min-height: unset;
max-height: 406px;
}
.sp-layout.sp-layout-expanded > .sp-stack:nth-child(1) {
max-height: unset;
}
.sp-layout.sp-layout-expanded > .sp-stack:nth-child(2) {
max-height: unset;
}
}
.expandable-callout .sp-stack:nth-child(2) {
min-width: 431px;
min-height: 40vh;
max-height: 40vh;
}