提交 | 用户 | age
|
a81268
|
1 |
/* BASICS */ |
V |
2 |
|
|
3 |
.CodeMirror { |
|
4 |
--base: #545281; |
|
5 |
--comment: hsl(210, 25%, 60%); |
|
6 |
--keyword: #af4ab1; |
|
7 |
--variable: #0055d1; |
|
8 |
--function: #c25205; |
|
9 |
--string: #2ba46d; |
|
10 |
--number: #c25205; |
|
11 |
--tags: #d00; |
|
12 |
--qualifier: #ff6032; |
|
13 |
--important: var(--string); |
|
14 |
|
55e9d9
|
15 |
position: relative; |
a81268
|
16 |
height: auto; |
V |
17 |
height: 100%; |
55e9d9
|
18 |
overflow: hidden; |
a81268
|
19 |
font-family: var(--font-code); |
55e9d9
|
20 |
background: white; |
a81268
|
21 |
direction: ltr; |
V |
22 |
} |
|
23 |
|
|
24 |
/* PADDING */ |
|
25 |
|
|
26 |
.CodeMirror-lines { |
55e9d9
|
27 |
min-height: 1px; /* prevents collapsing before first draw */ |
a81268
|
28 |
padding: 4px 0; /* Vertical padding around content */ |
55e9d9
|
29 |
cursor: text; |
a81268
|
30 |
} |
V |
31 |
|
|
32 |
.CodeMirror-scrollbar-filler, |
|
33 |
.CodeMirror-gutter-filler { |
|
34 |
background-color: white; /* The little square between H and V scrollbars */ |
|
35 |
} |
|
36 |
|
|
37 |
/* GUTTER */ |
|
38 |
|
|
39 |
.CodeMirror-gutters { |
55e9d9
|
40 |
position: absolute; |
V |
41 |
top: 0; |
|
42 |
left: 0; |
|
43 |
z-index: 3; |
|
44 |
min-height: 100%; |
a81268
|
45 |
white-space: nowrap; |
V |
46 |
background-color: transparent; |
|
47 |
border-right: 1px solid #ddd; |
|
48 |
} |
|
49 |
|
|
50 |
.CodeMirror-linenumber { |
|
51 |
min-width: 20px; |
|
52 |
padding: 0 3px 0 5px; |
|
53 |
color: var(--comment); |
|
54 |
text-align: right; |
|
55 |
white-space: nowrap; |
|
56 |
opacity: 0.6; |
|
57 |
} |
|
58 |
|
|
59 |
.CodeMirror-guttermarker { |
|
60 |
color: black; |
|
61 |
} |
|
62 |
|
|
63 |
.CodeMirror-guttermarker-subtle { |
|
64 |
color: #999; |
|
65 |
} |
|
66 |
|
|
67 |
/* FOLD GUTTER */ |
|
68 |
|
|
69 |
.CodeMirror-foldmarker { |
|
70 |
font-family: arial; |
|
71 |
line-height: 0.3; |
|
72 |
color: #414141; |
|
73 |
text-shadow: #f96 1px 1px 2px, #f96 -1px -1px 2px, #f96 1px -1px 2px, #f96 -1px 1px 2px; |
|
74 |
cursor: pointer; |
|
75 |
} |
|
76 |
|
|
77 |
.CodeMirror-foldgutter { |
|
78 |
width: 0.7em; |
|
79 |
} |
|
80 |
|
|
81 |
.CodeMirror-foldgutter-open, |
|
82 |
.CodeMirror-foldgutter-folded { |
|
83 |
cursor: pointer; |
|
84 |
} |
|
85 |
|
|
86 |
.CodeMirror-foldgutter-open::after, |
|
87 |
.CodeMirror-foldgutter-folded::after { |
|
88 |
position: relative; |
|
89 |
top: -0.1em; |
|
90 |
display: inline-block; |
|
91 |
font-size: 0.8em; |
|
92 |
content: '>'; |
|
93 |
opacity: 0.8; |
|
94 |
transform: rotate(90deg); |
|
95 |
transition: transform 0.2s; |
|
96 |
} |
|
97 |
|
|
98 |
.CodeMirror-foldgutter-folded::after { |
|
99 |
transform: none; |
|
100 |
} |
|
101 |
|
|
102 |
/* CURSOR */ |
|
103 |
|
|
104 |
.CodeMirror-cursor { |
55e9d9
|
105 |
position: absolute; |
a81268
|
106 |
width: 0; |
55e9d9
|
107 |
pointer-events: none; |
a81268
|
108 |
border-right: none; |
V |
109 |
border-left: 1px solid black; |
|
110 |
} |
|
111 |
|
|
112 |
/* Shown when moving in bi-directional text */ |
|
113 |
.CodeMirror div.CodeMirror-secondarycursor { |
|
114 |
border-left: 1px solid silver; |
|
115 |
} |
|
116 |
|
|
117 |
.cm-fat-cursor .CodeMirror-cursor { |
|
118 |
width: auto; |
|
119 |
background: #7e7; |
|
120 |
border: 0 !important; |
|
121 |
} |
|
122 |
|
|
123 |
.cm-fat-cursor div.CodeMirror-cursors { |
|
124 |
z-index: 1; |
|
125 |
} |
|
126 |
|
|
127 |
.cm-fat-cursor-mark { |
|
128 |
background-color: rgba(20, 255, 20, 0.5); |
|
129 |
-webkit-animation: blink 1.06s steps(1) infinite; |
|
130 |
-moz-animation: blink 1.06s steps(1) infinite; |
|
131 |
animation: blink 1.06s steps(1) infinite; |
|
132 |
} |
|
133 |
|
|
134 |
.cm-animate-fat-cursor { |
|
135 |
width: auto; |
|
136 |
background-color: #7e7; |
|
137 |
border: 0; |
|
138 |
-webkit-animation: blink 1.06s steps(1) infinite; |
|
139 |
-moz-animation: blink 1.06s steps(1) infinite; |
|
140 |
animation: blink 1.06s steps(1) infinite; |
|
141 |
} |
|
142 |
@-moz-keyframes blink { |
|
143 |
50% { |
|
144 |
background-color: transparent; |
|
145 |
} |
|
146 |
} |
|
147 |
@-webkit-keyframes blink { |
|
148 |
50% { |
|
149 |
background-color: transparent; |
|
150 |
} |
|
151 |
} |
|
152 |
@keyframes blink { |
|
153 |
50% { |
|
154 |
background-color: transparent; |
|
155 |
} |
|
156 |
} |
|
157 |
|
|
158 |
.cm-tab { |
|
159 |
display: inline-block; |
|
160 |
text-decoration: inherit; |
|
161 |
} |
|
162 |
|
|
163 |
.CodeMirror-rulers { |
|
164 |
position: absolute; |
|
165 |
top: -50px; |
|
166 |
right: 0; |
|
167 |
bottom: -20px; |
|
168 |
left: 0; |
|
169 |
overflow: hidden; |
|
170 |
} |
|
171 |
|
|
172 |
.CodeMirror-ruler { |
|
173 |
position: absolute; |
|
174 |
top: 0; |
|
175 |
bottom: 0; |
|
176 |
border-left: 1px solid #ccc; |
|
177 |
} |
|
178 |
|
|
179 |
/* DEFAULT THEME */ |
|
180 |
.cm-s-default.CodeMirror { |
|
181 |
background-color: transparent; |
|
182 |
} |
|
183 |
|
|
184 |
.cm-s-default .cm-header { |
|
185 |
color: blue; |
|
186 |
} |
|
187 |
|
|
188 |
.cm-s-default .cm-quote { |
|
189 |
color: #090; |
|
190 |
} |
|
191 |
|
|
192 |
.cm-negative { |
|
193 |
color: #d44; |
|
194 |
} |
|
195 |
|
|
196 |
.cm-positive { |
|
197 |
color: #292; |
|
198 |
} |
|
199 |
|
|
200 |
.cm-header, |
|
201 |
.cm-strong { |
|
202 |
font-weight: bold; |
|
203 |
} |
|
204 |
|
|
205 |
.cm-em { |
|
206 |
font-style: italic; |
|
207 |
} |
|
208 |
|
|
209 |
.cm-link { |
|
210 |
text-decoration: underline; |
|
211 |
} |
|
212 |
|
|
213 |
.cm-strikethrough { |
|
214 |
text-decoration: line-through; |
|
215 |
} |
|
216 |
|
|
217 |
.cm-s-default .cm-atom, |
|
218 |
.cm-s-default .cm-def, |
|
219 |
.cm-s-default .cm-property, |
|
220 |
.cm-s-default .cm-variable-2, |
|
221 |
.cm-s-default .cm-variable-3, |
|
222 |
.cm-s-default .cm-punctuation { |
|
223 |
color: var(--base); |
|
224 |
} |
|
225 |
|
|
226 |
.cm-s-default .cm-hr, |
|
227 |
.cm-s-default .cm-comment { |
|
228 |
color: var(--comment); |
|
229 |
} |
|
230 |
|
|
231 |
.cm-s-default .cm-attribute, |
|
232 |
.cm-s-default .cm-keyword { |
|
233 |
color: var(--keyword); |
|
234 |
} |
|
235 |
|
|
236 |
.cm-s-default .cm-variable { |
|
237 |
color: var(--variable); |
|
238 |
} |
|
239 |
|
|
240 |
.cm-s-default .cm-bracket, |
|
241 |
.cm-s-default .cm-tag { |
|
242 |
color: var(--tags); |
|
243 |
} |
|
244 |
|
|
245 |
.cm-s-default .cm-number { |
|
246 |
color: var(--number); |
|
247 |
} |
|
248 |
|
|
249 |
.cm-s-default .cm-string, |
|
250 |
.cm-s-default .cm-string-2 { |
|
251 |
color: var(--string); |
|
252 |
} |
|
253 |
|
|
254 |
.cm-s-default .cm-type { |
|
255 |
color: #085; |
|
256 |
} |
|
257 |
|
|
258 |
.cm-s-default .cm-meta { |
|
259 |
color: #555; |
|
260 |
} |
|
261 |
|
|
262 |
.cm-s-default .cm-qualifier { |
|
263 |
color: var(--qualifier); |
|
264 |
} |
|
265 |
|
|
266 |
.cm-s-default .cm-builtin { |
|
267 |
color: #7539ff; |
|
268 |
} |
|
269 |
|
|
270 |
.cm-s-default .cm-link { |
|
271 |
color: var(--flash); |
|
272 |
} |
|
273 |
|
|
274 |
.cm-s-default .cm-error { |
|
275 |
color: #ff008c; |
|
276 |
} |
|
277 |
|
|
278 |
.cm-invalidchar { |
|
279 |
color: #ff008c; |
|
280 |
} |
|
281 |
|
|
282 |
.CodeMirror-composing { |
|
283 |
border-bottom: 2px solid; |
|
284 |
} |
|
285 |
|
|
286 |
/* Default styles for common addons */ |
|
287 |
|
|
288 |
div.CodeMirror span.CodeMirror-matchingbracket { |
|
289 |
color: #0b0; |
|
290 |
} |
|
291 |
|
|
292 |
div.CodeMirror span.CodeMirror-nonmatchingbracket { |
|
293 |
color: #a22; |
|
294 |
} |
|
295 |
|
|
296 |
.CodeMirror-matchingtag { |
|
297 |
background: rgba(255, 150, 0, 0.3); |
|
298 |
} |
|
299 |
|
|
300 |
.CodeMirror-activeline-background { |
|
301 |
background: #e8f2ff; |
|
302 |
} |
|
303 |
|
|
304 |
/* STOP */ |
|
305 |
|
|
306 |
/* The rest of this file contains styles related to the mechanics of |
|
307 |
the editor. You probably shouldn't touch them. */ |
|
308 |
|
|
309 |
.CodeMirror-scroll { |
|
310 |
position: relative; |
|
311 |
height: 100%; |
|
312 |
padding-bottom: 30px; |
|
313 |
margin-right: -30px; |
|
314 |
|
|
315 |
/* 30px is the magic margin used to hide the element's real scrollbars */ |
|
316 |
|
|
317 |
/* See overflow: hidden in .CodeMirror */ |
|
318 |
margin-bottom: -30px; |
|
319 |
overflow: scroll !important; /* Things will break if this is overridden */ |
|
320 |
outline: none; /* Prevent dragging from highlighting the element */ |
|
321 |
} |
|
322 |
|
|
323 |
.CodeMirror-sizer { |
|
324 |
position: relative; |
566280
|
325 |
margin-bottom: 20px !important; |
a81268
|
326 |
border-right: 30px solid transparent; |
V |
327 |
} |
|
328 |
|
|
329 |
/* The fake, visible scrollbars. Used to force redraw during scrolling |
|
330 |
before actual scrolling happens, thus preventing shaking and |
|
331 |
flickering artifacts. */ |
|
332 |
.CodeMirror-vscrollbar, |
|
333 |
.CodeMirror-hscrollbar, |
|
334 |
.CodeMirror-scrollbar-filler, |
|
335 |
.CodeMirror-gutter-filler { |
|
336 |
position: absolute; |
|
337 |
z-index: 6; |
|
338 |
display: none; |
|
339 |
} |
|
340 |
|
|
341 |
.CodeMirror-vscrollbar { |
|
342 |
top: 0; |
|
343 |
right: 0; |
|
344 |
overflow-x: hidden; |
|
345 |
overflow-y: scroll; |
|
346 |
} |
|
347 |
|
|
348 |
.CodeMirror-hscrollbar { |
|
349 |
bottom: 0; |
|
350 |
left: 0; |
|
351 |
overflow-x: scroll; |
|
352 |
overflow-y: hidden; |
|
353 |
} |
|
354 |
|
|
355 |
.CodeMirror-scrollbar-filler { |
|
356 |
right: 0; |
|
357 |
bottom: 0; |
|
358 |
} |
|
359 |
|
|
360 |
.CodeMirror-gutter-filler { |
|
361 |
bottom: 0; |
|
362 |
left: 0; |
|
363 |
} |
|
364 |
|
|
365 |
.CodeMirror-gutter { |
|
366 |
display: inline-block; |
|
367 |
height: 100%; |
|
368 |
margin-bottom: -30px; |
|
369 |
white-space: normal; |
|
370 |
vertical-align: top; |
|
371 |
} |
|
372 |
|
|
373 |
.CodeMirror-gutter-wrapper { |
|
374 |
position: absolute; |
|
375 |
z-index: 4; |
|
376 |
background: none !important; |
|
377 |
border: none !important; |
|
378 |
} |
|
379 |
|
|
380 |
.CodeMirror-gutter-background { |
|
381 |
position: absolute; |
|
382 |
top: 0; |
|
383 |
bottom: 0; |
|
384 |
z-index: 4; |
|
385 |
} |
|
386 |
|
|
387 |
.CodeMirror-gutter-elt { |
|
388 |
position: absolute; |
|
389 |
z-index: 4; |
|
390 |
cursor: default; |
|
391 |
} |
|
392 |
|
|
393 |
.CodeMirror-gutter-wrapper ::selection { |
|
394 |
background-color: transparent; |
|
395 |
} |
|
396 |
|
|
397 |
.CodeMirror-gutter-wrapper ::-moz-selection { |
|
398 |
background-color: transparent; |
|
399 |
} |
|
400 |
|
|
401 |
.CodeMirror pre { |
|
402 |
position: relative; |
|
403 |
z-index: 2; |
55e9d9
|
404 |
padding: 0 4px; /* Horizontal padding of content */ |
a81268
|
405 |
margin: 0; |
V |
406 |
overflow: visible; |
|
407 |
font-family: inherit; |
|
408 |
font-size: inherit; |
|
409 |
line-height: inherit; |
|
410 |
color: inherit; |
|
411 |
word-wrap: normal; |
|
412 |
white-space: pre; |
|
413 |
background: transparent; |
|
414 |
border-width: 0; |
|
415 |
|
|
416 |
/* Reset some styles that the rest of the page might have set */ |
|
417 |
-moz-border-radius: 0; |
|
418 |
-webkit-border-radius: 0; |
|
419 |
border-radius: 0; |
|
420 |
-webkit-tap-highlight-color: transparent; |
|
421 |
-webkit-font-variant-ligatures: contextual; |
|
422 |
font-variant-ligatures: contextual; |
|
423 |
} |
|
424 |
|
|
425 |
.CodeMirror-wrap pre { |
|
426 |
word-break: normal; |
|
427 |
word-wrap: break-word; |
|
428 |
white-space: pre-wrap; |
|
429 |
} |
|
430 |
|
|
431 |
.CodeMirror-linebackground { |
|
432 |
position: absolute; |
|
433 |
top: 0; |
|
434 |
right: 0; |
|
435 |
bottom: 0; |
|
436 |
left: 0; |
|
437 |
z-index: 0; |
|
438 |
} |
|
439 |
|
|
440 |
.CodeMirror-linewidget { |
|
441 |
position: relative; |
|
442 |
z-index: 2; |
|
443 |
padding: 0.1px; /* Force widget margins to stay inside of the container */ |
|
444 |
} |
|
445 |
|
|
446 |
.CodeMirror-rtl pre { |
|
447 |
direction: rtl; |
|
448 |
} |
|
449 |
|
|
450 |
.CodeMirror-code { |
|
451 |
outline: none; |
|
452 |
} |
|
453 |
|
|
454 |
/* Force content-box sizing for the elements where we expect it */ |
|
455 |
.CodeMirror-scroll, |
|
456 |
.CodeMirror-sizer, |
|
457 |
.CodeMirror-gutter, |
|
458 |
.CodeMirror-gutters, |
|
459 |
.CodeMirror-linenumber { |
|
460 |
-moz-box-sizing: content-box; |
|
461 |
box-sizing: content-box; |
|
462 |
} |
|
463 |
|
|
464 |
.CodeMirror-measure { |
|
465 |
position: absolute; |
|
466 |
width: 100%; |
|
467 |
height: 0; |
|
468 |
overflow: hidden; |
|
469 |
visibility: hidden; |
|
470 |
} |
|
471 |
|
|
472 |
.CodeMirror-measure pre { |
|
473 |
position: static; |
|
474 |
} |
|
475 |
|
|
476 |
div.CodeMirror-cursors { |
|
477 |
position: relative; |
|
478 |
z-index: 3; |
|
479 |
visibility: hidden; |
|
480 |
} |
|
481 |
|
|
482 |
div.CodeMirror-dragcursors { |
|
483 |
visibility: visible; |
|
484 |
} |
|
485 |
|
|
486 |
.CodeMirror-focused div.CodeMirror-cursors { |
|
487 |
visibility: visible; |
|
488 |
} |
|
489 |
|
|
490 |
.CodeMirror-selected { |
|
491 |
background: #d9d9d9; |
|
492 |
} |
|
493 |
|
|
494 |
.CodeMirror-focused .CodeMirror-selected { |
|
495 |
background: #d7d4f0; |
|
496 |
} |
|
497 |
|
|
498 |
.CodeMirror-crosshair { |
|
499 |
cursor: crosshair; |
|
500 |
} |
|
501 |
|
|
502 |
.CodeMirror-line::selection, |
|
503 |
.CodeMirror-line > span::selection, |
|
504 |
.CodeMirror-line > span > span::selection { |
|
505 |
background: #d7d4f0; |
|
506 |
} |
|
507 |
|
|
508 |
.CodeMirror-line::-moz-selection, |
|
509 |
.CodeMirror-line > span::-moz-selection, |
|
510 |
.CodeMirror-line > span > span::-moz-selection { |
|
511 |
background: #d7d4f0; |
|
512 |
} |
|
513 |
|
|
514 |
.cm-searching { |
|
515 |
background-color: #ffa; |
|
516 |
background-color: rgba(255, 255, 0, 0.4); |
|
517 |
} |
|
518 |
|
|
519 |
/* Used to force a border model for a node */ |
|
520 |
.cm-force-border { |
|
521 |
padding-right: 0.1px; |
|
522 |
} |
|
523 |
|
|
524 |
@media print { |
|
525 |
/* Hide the cursor when printing */ |
|
526 |
.CodeMirror div.CodeMirror-cursors { |
|
527 |
visibility: hidden; |
|
528 |
} |
|
529 |
} |
|
530 |
|
|
531 |
/* See issue #2901 */ |
|
532 |
.cm-tab-wrap-hack::after { |
|
533 |
content: ''; |
|
534 |
} |
|
535 |
|
|
536 |
/* Help users use markselection to safely style text background */ |
|
537 |
span.CodeMirror-selectedtext { |
|
538 |
background: none; |
|
539 |
} |