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