UNPKG

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