|
| 1 | +/* BASICS */ |
| 2 | + |
1 | 3 | .CodeMirror { |
2 | | - line-height: 1.2em; /* pgbovine - enables underscore (_) characters to render properly */ |
| 4 | + /* Set height, width, borders, and global font properties here */ |
3 | 5 | font-family: monospace; |
| 6 | + height: 300px; |
| 7 | +} |
| 8 | +.CodeMirror-scroll { |
| 9 | + /* Set scrolling behaviour here */ |
| 10 | + overflow: auto; |
| 11 | +} |
| 12 | + |
| 13 | +/* PADDING */ |
| 14 | + |
| 15 | +.CodeMirror-lines { |
| 16 | + padding: 4px 0; /* Vertical padding around content */ |
| 17 | +} |
| 18 | +.CodeMirror pre { |
| 19 | + padding: 0 4px; /* Horizontal padding of content */ |
| 20 | +} |
4 | 21 |
|
5 | | - /* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */ |
| 22 | +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { |
| 23 | + background-color: white; /* The little square between H and V scrollbars */ |
| 24 | +} |
| 25 | + |
| 26 | +/* GUTTER */ |
| 27 | + |
| 28 | +.CodeMirror-gutters { |
| 29 | + border-right: 1px solid #ddd; |
| 30 | + background-color: #f7f7f7; |
| 31 | + white-space: nowrap; |
| 32 | +} |
| 33 | +.CodeMirror-linenumbers {} |
| 34 | +.CodeMirror-linenumber { |
| 35 | + padding: 0 3px 0 5px; |
| 36 | + min-width: 20px; |
| 37 | + text-align: right; |
| 38 | + color: #999; |
| 39 | + -moz-box-sizing: content-box; |
| 40 | + box-sizing: content-box; |
| 41 | +} |
| 42 | + |
| 43 | +/* CURSOR */ |
| 44 | + |
| 45 | +.CodeMirror div.CodeMirror-cursor { |
| 46 | + border-left: 1px solid black; |
| 47 | +} |
| 48 | +/* Shown when moving in bi-directional text */ |
| 49 | +.CodeMirror div.CodeMirror-secondarycursor { |
| 50 | + border-left: 1px solid silver; |
| 51 | +} |
| 52 | +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { |
| 53 | + width: auto; |
| 54 | + border: 0; |
| 55 | + background: #7e7; |
| 56 | +} |
| 57 | +/* Can style cursor different in overwrite (non-insert) mode */ |
| 58 | +div.CodeMirror-overwrite div.CodeMirror-cursor {} |
| 59 | + |
| 60 | +.cm-tab { display: inline-block; } |
| 61 | + |
| 62 | +.CodeMirror-ruler { |
| 63 | + border-left: 1px solid #ccc; |
| 64 | + position: absolute; |
| 65 | +} |
| 66 | + |
| 67 | +/* DEFAULT THEME */ |
| 68 | + |
| 69 | +.cm-s-default .cm-keyword {color: #708;} |
| 70 | +.cm-s-default .cm-atom {color: #219;} |
| 71 | +.cm-s-default .cm-number {color: #164;} |
| 72 | +.cm-s-default .cm-def {color: #00f;} |
| 73 | +.cm-s-default .cm-variable, |
| 74 | +.cm-s-default .cm-punctuation, |
| 75 | +.cm-s-default .cm-property, |
| 76 | +.cm-s-default .cm-operator {} |
| 77 | +.cm-s-default .cm-variable-2 {color: #05a;} |
| 78 | +.cm-s-default .cm-variable-3 {color: #085;} |
| 79 | +.cm-s-default .cm-comment {color: #a50;} |
| 80 | +.cm-s-default .cm-string {color: #a11;} |
| 81 | +.cm-s-default .cm-string-2 {color: #f50;} |
| 82 | +.cm-s-default .cm-meta {color: #555;} |
| 83 | +.cm-s-default .cm-qualifier {color: #555;} |
| 84 | +.cm-s-default .cm-builtin {color: #30a;} |
| 85 | +.cm-s-default .cm-bracket {color: #997;} |
| 86 | +.cm-s-default .cm-tag {color: #170;} |
| 87 | +.cm-s-default .cm-attribute {color: #00c;} |
| 88 | +.cm-s-default .cm-header {color: blue;} |
| 89 | +.cm-s-default .cm-quote {color: #090;} |
| 90 | +.cm-s-default .cm-hr {color: #999;} |
| 91 | +.cm-s-default .cm-link {color: #00c;} |
| 92 | + |
| 93 | +.cm-negative {color: #d44;} |
| 94 | +.cm-positive {color: #292;} |
| 95 | +.cm-header, .cm-strong {font-weight: bold;} |
| 96 | +.cm-em {font-style: italic;} |
| 97 | +.cm-link {text-decoration: underline;} |
| 98 | + |
| 99 | +.cm-s-default .cm-error {color: #f00;} |
| 100 | +.cm-invalidchar {color: #f00;} |
| 101 | + |
| 102 | +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} |
| 103 | +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} |
| 104 | +.CodeMirror-activeline-background {background: #e8f2ff;} |
| 105 | + |
| 106 | +/* STOP */ |
| 107 | + |
| 108 | +/* The rest of this file contains styles related to the mechanics of |
| 109 | + the editor. You probably shouldn't touch them. */ |
| 110 | + |
| 111 | +.CodeMirror { |
| 112 | + line-height: 1; |
6 | 113 | position: relative; |
7 | | - /* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */ |
8 | 114 | overflow: hidden; |
| 115 | + background: white; |
| 116 | + color: black; |
9 | 117 | } |
10 | 118 |
|
11 | 119 | .CodeMirror-scroll { |
12 | | - overflow: auto; |
13 | | - height: 300px; |
14 | | - /* This is needed to prevent an IE[67] bug where the scrolled content |
15 | | - is visible outside of the scrolling box. */ |
| 120 | + /* 30px is the magic margin used to hide the element's real scrollbars */ |
| 121 | + /* See overflow: hidden in .CodeMirror */ |
| 122 | + margin-bottom: -30px; margin-right: -30px; |
| 123 | + padding-bottom: 30px; |
| 124 | + height: 100%; |
| 125 | + outline: none; /* Prevent dragging from highlighting the element */ |
16 | 126 | position: relative; |
17 | | - outline: none; |
| 127 | + -moz-box-sizing: content-box; |
| 128 | + box-sizing: content-box; |
| 129 | +} |
| 130 | +.CodeMirror-sizer { |
| 131 | + position: relative; |
| 132 | + border-right: 30px solid transparent; |
| 133 | + -moz-box-sizing: content-box; |
| 134 | + box-sizing: content-box; |
18 | 135 | } |
19 | 136 |
|
20 | | -/* Vertical scrollbar */ |
21 | | -.CodeMirror-scrollbar { |
| 137 | +/* The fake, visible scrollbars. Used to force redraw during scrolling |
| 138 | + before actuall scrolling happens, thus preventing shaking and |
| 139 | + flickering artifacts. */ |
| 140 | +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { |
22 | 141 | position: absolute; |
| 142 | + z-index: 6; |
| 143 | + display: none; |
| 144 | +} |
| 145 | +.CodeMirror-vscrollbar { |
23 | 146 | right: 0; top: 0; |
24 | 147 | overflow-x: hidden; |
25 | 148 | overflow-y: scroll; |
26 | | - z-index: 5; |
27 | 149 | } |
28 | | -.CodeMirror-scrollbar-inner { |
29 | | - /* This needs to have a nonzero width in order for the scrollbar to appear |
30 | | - in Firefox and IE9. */ |
31 | | - width: 1px; |
32 | | -} |
33 | | -.CodeMirror-scrollbar.cm-sb-overlap { |
34 | | - /* Ensure that the scrollbar appears in Lion, and that it overlaps the content |
35 | | - rather than sitting to the right of it. */ |
36 | | - position: absolute; |
37 | | - z-index: 1; |
38 | | - float: none; |
39 | | - right: 0; |
40 | | - min-width: 12px; |
| 150 | +.CodeMirror-hscrollbar { |
| 151 | + bottom: 0; left: 0; |
| 152 | + overflow-y: hidden; |
| 153 | + overflow-x: scroll; |
41 | 154 | } |
42 | | -.CodeMirror-scrollbar.cm-sb-nonoverlap { |
43 | | - min-width: 12px; |
| 155 | +.CodeMirror-scrollbar-filler { |
| 156 | + right: 0; bottom: 0; |
44 | 157 | } |
45 | | -.CodeMirror-scrollbar.cm-sb-ie7 { |
46 | | - min-width: 18px; |
| 158 | +.CodeMirror-gutter-filler { |
| 159 | + left: 0; bottom: 0; |
47 | 160 | } |
48 | 161 |
|
49 | | -.CodeMirror-gutter { |
| 162 | +.CodeMirror-gutters { |
50 | 163 | position: absolute; left: 0; top: 0; |
51 | | - z-index: 10; |
52 | | - background-color: #f7f7f7; |
53 | | - border-right: 1px solid #eee; |
54 | | - min-width: 2em; |
| 164 | + padding-bottom: 30px; |
| 165 | + z-index: 3; |
| 166 | +} |
| 167 | +.CodeMirror-gutter { |
| 168 | + white-space: normal; |
55 | 169 | height: 100%; |
| 170 | + -moz-box-sizing: content-box; |
| 171 | + box-sizing: content-box; |
| 172 | + padding-bottom: 30px; |
| 173 | + margin-bottom: -32px; |
| 174 | + display: inline-block; |
| 175 | + /* Hack to make IE7 behave */ |
| 176 | + *zoom:1; |
| 177 | + *display:inline; |
56 | 178 | } |
57 | | -.CodeMirror-gutter-text { |
58 | | - color: #aaa; |
59 | | - text-align: right; |
60 | | - padding: .4em .2em .4em .4em; |
61 | | - white-space: pre !important; |
| 179 | +.CodeMirror-gutter-elt { |
| 180 | + position: absolute; |
62 | 181 | cursor: default; |
| 182 | + z-index: 4; |
63 | 183 | } |
| 184 | + |
64 | 185 | .CodeMirror-lines { |
65 | | - padding: .4em; |
66 | | - white-space: pre; |
67 | 186 | cursor: text; |
68 | 187 | } |
69 | | - |
70 | 188 | .CodeMirror pre { |
71 | | - -moz-border-radius: 0; |
72 | | - -webkit-border-radius: 0; |
73 | | - -o-border-radius: 0; |
74 | | - border-radius: 0; |
75 | | - border-width: 0; margin: 0; padding: 0; background: transparent; |
| 189 | + /* Reset some styles that the rest of the page might have set */ |
| 190 | + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; |
| 191 | + border-width: 0; |
| 192 | + background: transparent; |
76 | 193 | font-family: inherit; |
77 | 194 | font-size: inherit; |
78 | | - padding: 0; margin: 0; |
| 195 | + margin: 0; |
79 | 196 | white-space: pre; |
80 | 197 | word-wrap: normal; |
81 | 198 | line-height: inherit; |
82 | 199 | color: inherit; |
| 200 | + z-index: 2; |
| 201 | + position: relative; |
| 202 | + overflow: visible; |
83 | 203 | } |
84 | | - |
85 | 204 | .CodeMirror-wrap pre { |
86 | 205 | word-wrap: break-word; |
87 | 206 | white-space: pre-wrap; |
88 | 207 | word-break: normal; |
89 | 208 | } |
| 209 | + |
| 210 | +.CodeMirror-linebackground { |
| 211 | + position: absolute; |
| 212 | + left: 0; right: 0; top: 0; bottom: 0; |
| 213 | + z-index: 0; |
| 214 | +} |
| 215 | + |
| 216 | +.CodeMirror-linewidget { |
| 217 | + position: relative; |
| 218 | + z-index: 2; |
| 219 | + overflow: auto; |
| 220 | +} |
| 221 | + |
| 222 | +.CodeMirror-widget {} |
| 223 | + |
90 | 224 | .CodeMirror-wrap .CodeMirror-scroll { |
91 | 225 | overflow-x: hidden; |
92 | 226 | } |
93 | 227 |
|
94 | | -.CodeMirror textarea { |
95 | | - outline: none !important; |
| 228 | +.CodeMirror-measure { |
| 229 | + position: absolute; |
| 230 | + width: 100%; |
| 231 | + height: 0; |
| 232 | + overflow: hidden; |
| 233 | + visibility: hidden; |
96 | 234 | } |
| 235 | +.CodeMirror-measure pre { position: static; } |
97 | 236 |
|
98 | | -.CodeMirror pre.CodeMirror-cursor { |
99 | | - z-index: 10; |
| 237 | +.CodeMirror div.CodeMirror-cursor { |
100 | 238 | position: absolute; |
101 | | - visibility: hidden; |
102 | | - border-left: 1px solid black; |
103 | 239 | border-right: none; |
104 | 240 | width: 0; |
105 | 241 | } |
106 | | -.cm-keymap-fat-cursor pre.CodeMirror-cursor { |
107 | | - width: auto; |
108 | | - border: 0; |
109 | | - background: transparent; |
110 | | - background: rgba(0, 200, 0, .4); |
111 | | - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800); |
112 | | -} |
113 | | -/* Kludge to turn off filter in ie9+, which also accepts rgba */ |
114 | | -.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) { |
115 | | - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); |
| 242 | + |
| 243 | +div.CodeMirror-cursors { |
| 244 | + visibility: hidden; |
| 245 | + position: relative; |
| 246 | + z-index: 1; |
116 | 247 | } |
117 | | -.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {} |
118 | | -.CodeMirror-focused pre.CodeMirror-cursor { |
| 248 | +.CodeMirror-focused div.CodeMirror-cursors { |
119 | 249 | visibility: visible; |
120 | 250 | } |
121 | 251 |
|
122 | | -div.CodeMirror-selected { background: #d9d9d9; } |
123 | | -.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; } |
| 252 | +.CodeMirror-selected { background: #d9d9d9; } |
| 253 | +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } |
| 254 | +.CodeMirror-crosshair { cursor: crosshair; } |
124 | 255 |
|
125 | | -.CodeMirror-searching { |
| 256 | +.cm-searching { |
126 | 257 | background: #ffa; |
127 | 258 | background: rgba(255, 255, 0, .4); |
128 | 259 | } |
129 | 260 |
|
130 | | -/* Default theme */ |
131 | | - |
132 | | -.cm-s-default span.cm-keyword {color: #708;} |
133 | | -.cm-s-default span.cm-atom {color: #219;} |
134 | | -.cm-s-default span.cm-number {color: #164;} |
135 | | -.cm-s-default span.cm-def {color: #00f;} |
136 | | -.cm-s-default span.cm-variable {color: black;} |
137 | | -.cm-s-default span.cm-variable-2 {color: #05a;} |
138 | | -.cm-s-default span.cm-variable-3 {color: #085;} |
139 | | -.cm-s-default span.cm-property {color: black;} |
140 | | -.cm-s-default span.cm-operator {color: black;} |
141 | | -.cm-s-default span.cm-comment {color: #a50;} |
142 | | -.cm-s-default span.cm-string {color: #a11;} |
143 | | -.cm-s-default span.cm-string-2 {color: #f50;} |
144 | | -.cm-s-default span.cm-meta {color: #555;} |
145 | | -.cm-s-default span.cm-error {color: #f00;} |
146 | | -.cm-s-default span.cm-qualifier {color: #555;} |
147 | | -.cm-s-default span.cm-builtin {color: #30a;} |
148 | | -.cm-s-default span.cm-bracket {color: #cc7;} |
149 | | -.cm-s-default span.cm-tag {color: #170;} |
150 | | -.cm-s-default span.cm-attribute {color: #00c;} |
151 | | -.cm-s-default span.cm-header {color: blue;} |
152 | | -.cm-s-default span.cm-quote {color: #090;} |
153 | | -.cm-s-default span.cm-hr {color: #999;} |
154 | | -.cm-s-default span.cm-link {color: #00c;} |
155 | | - |
156 | | -span.cm-header, span.cm-strong {font-weight: bold;} |
157 | | -span.cm-em {font-style: italic;} |
158 | | -span.cm-emstrong {font-style: italic; font-weight: bold;} |
159 | | -span.cm-link {text-decoration: underline;} |
160 | | - |
161 | | -span.cm-invalidchar {color: #f00;} |
| 261 | +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ |
| 262 | +.CodeMirror span { *vertical-align: text-bottom; } |
162 | 263 |
|
163 | | -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} |
164 | | -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} |
| 264 | +/* Used to force a border model for a node */ |
| 265 | +.cm-force-border { padding-right: .1px; } |
165 | 266 |
|
166 | 267 | @media print { |
167 | | - |
168 | 268 | /* Hide the cursor when printing */ |
169 | | - .CodeMirror pre.CodeMirror-cursor { |
| 269 | + .CodeMirror div.CodeMirror-cursors { |
170 | 270 | visibility: hidden; |
171 | 271 | } |
172 | | - |
173 | 272 | } |
0 commit comments