提交 | 用户 | 时间
|
e7c126
|
1 |
/* |
H |
2 |
* Copyright 1999-2018 Alibaba Group Holding Ltd. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
/* BASICS */ |
|
18 |
|
|
19 |
.CodeMirror { |
|
20 |
/* Set height, width, borders, and global font properties here */ |
|
21 |
font-family: monospace; |
|
22 |
height: 300px; |
|
23 |
color: black; |
|
24 |
} |
|
25 |
|
|
26 |
/* PADDING */ |
|
27 |
|
|
28 |
.CodeMirror-lines { |
|
29 |
padding: 4px 0; /* Vertical padding around content */ |
|
30 |
} |
|
31 |
.CodeMirror pre { |
|
32 |
padding: 0 4px; /* Horizontal padding of content */ |
|
33 |
} |
|
34 |
|
|
35 |
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { |
|
36 |
background-color: white; /* The little square between H and V scrollbars */ |
|
37 |
} |
|
38 |
|
|
39 |
/* GUTTER */ |
|
40 |
|
|
41 |
.CodeMirror-gutters { |
|
42 |
border-right: 1px solid #ddd; |
|
43 |
background-color: #f7f7f7; |
|
44 |
white-space: nowrap; |
|
45 |
} |
|
46 |
.CodeMirror-linenumbers {} |
|
47 |
.CodeMirror-linenumber { |
|
48 |
padding: 0 3px 0 5px; |
|
49 |
min-width: 20px; |
|
50 |
text-align: right; |
|
51 |
color: #999; |
|
52 |
white-space: nowrap; |
|
53 |
} |
|
54 |
|
|
55 |
.CodeMirror-guttermarker { color: black; } |
|
56 |
.CodeMirror-guttermarker-subtle { color: #999; } |
|
57 |
|
|
58 |
/* CURSOR */ |
|
59 |
|
|
60 |
.CodeMirror-cursor { |
|
61 |
border-left: 1px solid black; |
|
62 |
border-right: none; |
|
63 |
width: 0; |
|
64 |
} |
|
65 |
/* Shown when moving in bi-directional text */ |
|
66 |
.CodeMirror div.CodeMirror-secondarycursor { |
|
67 |
border-left: 1px solid silver; |
|
68 |
} |
|
69 |
.cm-fat-cursor .CodeMirror-cursor { |
|
70 |
width: auto; |
|
71 |
border: 0 !important; |
|
72 |
background: #7e7; |
|
73 |
} |
|
74 |
.cm-fat-cursor div.CodeMirror-cursors { |
|
75 |
z-index: 1; |
|
76 |
} |
|
77 |
|
|
78 |
.cm-animate-fat-cursor { |
|
79 |
width: auto; |
|
80 |
border: 0; |
|
81 |
-webkit-animation: blink 1.06s steps(1) infinite; |
|
82 |
-moz-animation: blink 1.06s steps(1) infinite; |
|
83 |
animation: blink 1.06s steps(1) infinite; |
|
84 |
background-color: #7e7; |
|
85 |
} |
|
86 |
@-moz-keyframes blink { |
|
87 |
0% {} |
|
88 |
50% { background-color: transparent; } |
|
89 |
100% {} |
|
90 |
} |
|
91 |
@-webkit-keyframes blink { |
|
92 |
0% {} |
|
93 |
50% { background-color: transparent; } |
|
94 |
100% {} |
|
95 |
} |
|
96 |
@keyframes blink { |
|
97 |
0% {} |
|
98 |
50% { background-color: transparent; } |
|
99 |
100% {} |
|
100 |
} |
|
101 |
|
|
102 |
/* Can style cursor different in overwrite (non-insert) mode */ |
|
103 |
.CodeMirror-overwrite .CodeMirror-cursor {} |
|
104 |
|
|
105 |
.cm-tab { display: inline-block; text-decoration: inherit; } |
|
106 |
|
|
107 |
.CodeMirror-rulers { |
|
108 |
position: absolute; |
|
109 |
left: 0; right: 0; top: -50px; bottom: -20px; |
|
110 |
overflow: hidden; |
|
111 |
} |
|
112 |
.CodeMirror-ruler { |
|
113 |
border-left: 1px solid #ccc; |
|
114 |
top: 0; bottom: 0; |
|
115 |
position: absolute; |
|
116 |
} |
|
117 |
|
|
118 |
/* DEFAULT THEME */ |
|
119 |
|
|
120 |
.cm-s-default .cm-header {color: blue;} |
|
121 |
.cm-s-default .cm-quote {color: #090;} |
|
122 |
.cm-negative {color: #d44;} |
|
123 |
.cm-positive {color: #292;} |
|
124 |
.cm-header, .cm-strong {font-weight: bold;} |
|
125 |
.cm-em {font-style: italic;} |
|
126 |
.cm-link {text-decoration: underline;} |
|
127 |
.cm-strikethrough {text-decoration: line-through;} |
|
128 |
|
|
129 |
.cm-s-default .cm-keyword {color: #708;} |
|
130 |
.cm-s-default .cm-atom {color: #219;} |
|
131 |
.cm-s-default .cm-number {color: #164;} |
|
132 |
.cm-s-default .cm-def {color: #00f;} |
|
133 |
.cm-s-default .cm-variable, |
|
134 |
.cm-s-default .cm-punctuation, |
|
135 |
.cm-s-default .cm-property, |
|
136 |
.cm-s-default .cm-operator {} |
|
137 |
.cm-s-default .cm-variable-2 {color: #05a;} |
|
138 |
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} |
|
139 |
.cm-s-default .cm-comment {color: #a50;} |
|
140 |
.cm-s-default .cm-string {color: #a11;} |
|
141 |
.cm-s-default .cm-string-2 {color: #f50;} |
|
142 |
.cm-s-default .cm-meta {color: #555;} |
|
143 |
.cm-s-default .cm-qualifier {color: #555;} |
|
144 |
.cm-s-default .cm-builtin {color: #30a;} |
|
145 |
.cm-s-default .cm-bracket {color: #997;} |
|
146 |
.cm-s-default .cm-tag {color: #170;} |
|
147 |
.cm-s-default .cm-attribute {color: #00c;} |
|
148 |
.cm-s-default .cm-hr {color: #999;} |
|
149 |
.cm-s-default .cm-link {color: #00c;} |
|
150 |
|
|
151 |
.cm-s-default .cm-error {color: #f00;} |
|
152 |
.cm-invalidchar {color: #f00;} |
|
153 |
|
|
154 |
.CodeMirror-composing { border-bottom: 2px solid; } |
|
155 |
|
|
156 |
/* Default styles for common addons */ |
|
157 |
|
|
158 |
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} |
|
159 |
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} |
|
160 |
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } |
|
161 |
.CodeMirror-activeline-background {background: #e8f2ff;} |
|
162 |
|
|
163 |
/* STOP */ |
|
164 |
|
|
165 |
/* The rest of this file contains styles related to the mechanics of |
|
166 |
the editor. You probably shouldn't touch them. */ |
|
167 |
|
|
168 |
.CodeMirror { |
|
169 |
position: relative; |
|
170 |
overflow: hidden; |
|
171 |
background: white; |
|
172 |
} |
|
173 |
|
|
174 |
.CodeMirror-scroll { |
|
175 |
overflow: scroll !important; /* Things will break if this is overridden */ |
|
176 |
/* 30px is the magic margin used to hide the element's real scrollbars */ |
|
177 |
/* See overflow: hidden in .CodeMirror */ |
|
178 |
margin-bottom: -30px; margin-right: -30px; |
|
179 |
padding-bottom: 30px; |
|
180 |
height: 100%; |
|
181 |
outline: none; /* Prevent dragging from highlighting the element */ |
|
182 |
position: relative; |
|
183 |
} |
|
184 |
.CodeMirror-sizer { |
|
185 |
position: relative; |
|
186 |
border-right: 30px solid transparent; |
|
187 |
} |
|
188 |
|
|
189 |
/* The fake, visible scrollbars. Used to force redraw during scrolling |
|
190 |
before actual scrolling happens, thus preventing shaking and |
|
191 |
flickering artifacts. */ |
|
192 |
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { |
|
193 |
position: absolute; |
|
194 |
z-index: 6; |
|
195 |
display: none; |
|
196 |
} |
|
197 |
.CodeMirror-vscrollbar { |
|
198 |
right: 0; top: 0; |
|
199 |
overflow-x: hidden; |
|
200 |
overflow-y: scroll; |
|
201 |
} |
|
202 |
.CodeMirror-hscrollbar { |
|
203 |
bottom: 0; left: 0; |
|
204 |
overflow-y: hidden; |
|
205 |
overflow-x: scroll; |
|
206 |
} |
|
207 |
.CodeMirror-scrollbar-filler { |
|
208 |
right: 0; bottom: 0; |
|
209 |
} |
|
210 |
.CodeMirror-gutter-filler { |
|
211 |
left: 0; bottom: 0; |
|
212 |
} |
|
213 |
|
|
214 |
.CodeMirror-gutters { |
|
215 |
position: absolute; left: 0; top: 0; |
|
216 |
min-height: 100%; |
|
217 |
z-index: 3; |
|
218 |
} |
|
219 |
.CodeMirror-gutter { |
|
220 |
white-space: normal; |
|
221 |
height: 100%; |
|
222 |
display: inline-block; |
|
223 |
vertical-align: top; |
|
224 |
margin-bottom: -30px; |
|
225 |
} |
|
226 |
.CodeMirror-gutter-wrapper { |
|
227 |
position: absolute; |
|
228 |
z-index: 4; |
|
229 |
background: none !important; |
|
230 |
border: none !important; |
|
231 |
} |
|
232 |
.CodeMirror-gutter-background { |
|
233 |
position: absolute; |
|
234 |
top: 0; bottom: 0; |
|
235 |
z-index: 4; |
|
236 |
} |
|
237 |
.CodeMirror-gutter-elt { |
|
238 |
position: absolute; |
|
239 |
cursor: default; |
|
240 |
z-index: 4; |
|
241 |
} |
|
242 |
.CodeMirror-gutter-wrapper ::selection { background-color: transparent } |
|
243 |
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } |
|
244 |
|
|
245 |
.CodeMirror-lines { |
|
246 |
cursor: text; |
|
247 |
min-height: 1px; /* prevents collapsing before first draw */ |
|
248 |
} |
|
249 |
.CodeMirror pre { |
|
250 |
/* Reset some styles that the rest of the page might have set */ |
|
251 |
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; |
|
252 |
border-width: 0; |
|
253 |
background: transparent; |
|
254 |
font-family: inherit; |
|
255 |
font-size: inherit; |
|
256 |
margin: 0; |
|
257 |
white-space: pre; |
|
258 |
word-wrap: normal; |
|
259 |
line-height: inherit; |
|
260 |
color: inherit; |
|
261 |
z-index: 2; |
|
262 |
position: relative; |
|
263 |
overflow: visible; |
|
264 |
-webkit-tap-highlight-color: transparent; |
|
265 |
-webkit-font-variant-ligatures: contextual; |
|
266 |
font-variant-ligatures: contextual; |
|
267 |
} |
|
268 |
.CodeMirror-wrap pre { |
|
269 |
word-wrap: break-word; |
|
270 |
white-space: pre-wrap; |
|
271 |
word-break: normal; |
|
272 |
} |
|
273 |
|
|
274 |
.CodeMirror-linebackground { |
|
275 |
position: absolute; |
|
276 |
left: 0; right: 0; top: 0; bottom: 0; |
|
277 |
z-index: 0; |
|
278 |
} |
|
279 |
|
|
280 |
.CodeMirror-linewidget { |
|
281 |
position: relative; |
|
282 |
z-index: 2; |
|
283 |
overflow: auto; |
|
284 |
} |
|
285 |
|
|
286 |
.CodeMirror-widget {} |
|
287 |
|
|
288 |
.CodeMirror-rtl pre { direction: rtl; } |
|
289 |
|
|
290 |
.CodeMirror-code { |
|
291 |
outline: none; |
|
292 |
} |
|
293 |
|
|
294 |
/* Force content-box sizing for the elements where we expect it */ |
|
295 |
.CodeMirror-scroll, |
|
296 |
.CodeMirror-sizer, |
|
297 |
.CodeMirror-gutter, |
|
298 |
.CodeMirror-gutters, |
|
299 |
.CodeMirror-linenumber { |
|
300 |
-moz-box-sizing: content-box; |
|
301 |
box-sizing: content-box; |
|
302 |
} |
|
303 |
|
|
304 |
.CodeMirror-measure { |
|
305 |
position: absolute; |
|
306 |
width: 100%; |
|
307 |
height: 0; |
|
308 |
overflow: hidden; |
|
309 |
visibility: hidden; |
|
310 |
} |
|
311 |
|
|
312 |
.CodeMirror-cursor { |
|
313 |
position: absolute; |
|
314 |
pointer-events: none; |
|
315 |
} |
|
316 |
.CodeMirror-measure pre { position: static; } |
|
317 |
|
|
318 |
div.CodeMirror-cursors { |
|
319 |
visibility: hidden; |
|
320 |
position: relative; |
|
321 |
z-index: 3; |
|
322 |
} |
|
323 |
div.CodeMirror-dragcursors { |
|
324 |
visibility: visible; |
|
325 |
} |
|
326 |
|
|
327 |
.CodeMirror-focused div.CodeMirror-cursors { |
|
328 |
visibility: visible; |
|
329 |
} |
|
330 |
|
|
331 |
.CodeMirror-selected { background: #d9d9d9; } |
|
332 |
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } |
|
333 |
.CodeMirror-crosshair { cursor: crosshair; } |
|
334 |
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } |
|
335 |
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } |
|
336 |
|
|
337 |
.cm-searching { |
|
338 |
background: #ffa; |
|
339 |
background: rgba(255, 255, 0, .4); |
|
340 |
} |
|
341 |
|
|
342 |
/* Used to force a border model for a node */ |
|
343 |
.cm-force-border { padding-right: .1px; } |
|
344 |
|
|
345 |
@media print { |
|
346 |
/* Hide the cursor when printing */ |
|
347 |
.CodeMirror div.CodeMirror-cursors { |
|
348 |
visibility: hidden; |
|
349 |
} |
|
350 |
} |
|
351 |
|
|
352 |
/* See issue #2901 */ |
|
353 |
.cm-tab-wrap-hack:after { content: ''; } |
|
354 |
|
|
355 |
/* Help users use markselection to safely style text background */ |
|
356 |
span.CodeMirror-selectedtext { background: none; } |