mozilla.css (14212B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 6 :root { 7 --breakpoint-active-color: light-dark(rgba(44,187,15,.2), rgba(0,255,175,.4)); 8 --breakpoint-active-color-hover: light-dark(rgba(44,187,15,.5), rgba(0,255,175,.7);); 9 --gutter-background-color: var(--theme-sidebar-background); 10 --gutter-border-color: light-dark(var(--theme-splitter-color), var(--theme-toolbar-background)); 11 --highlight-line-duration: 5000ms; 12 &[forced-colors-active] { 13 /* overriding variable in HCM so the border is actually visible (see Bug 1953376) */ 14 --gutter-border-color: var(--theme-splitter-color); 15 } 16 } 17 18 /* We don't want the focus style to be displayed on the CodeMirror scrollbars. 19 * See Bug 1590707. 20 */ 21 .CodeMirror-vscrollbar, .CodeMirror-hscrollbar { 22 outline: none !important; 23 } 24 25 .CodeMirror .errors { 26 width: 16px; 27 } 28 29 .CodeMirror .error { 30 display: inline-block; 31 margin-left: 5px; 32 width: 12px; 33 height: 12px; 34 background-repeat: no-repeat; 35 background-position: center; 36 background-size: contain; 37 opacity: 0.75; 38 } 39 40 .CodeMirror .hit-counts { 41 width: 6px; 42 } 43 44 .CodeMirror .hit-count { 45 display: inline-block; 46 height: 12px; 47 border: solid rgba(0,0,0,0.2); 48 border-width: 1px 1px 1px 0; 49 border-radius: 0 3px 3px 0; 50 padding: 0 3px; 51 font-size: 10px; 52 pointer-events: none; 53 } 54 55 .CodeMirror-linenumber:before { 56 content: " "; 57 display: block; 58 width: calc(100% - 3px); 59 position: absolute; 60 top: 1px; 61 left: 0; 62 height: 12px; 63 z-index: -1; 64 background-size: calc(100% - 2px) 12px; 65 background-repeat: no-repeat; 66 background-position: right center; 67 padding-inline-end: 9px; 68 } 69 70 .breakpoint .CodeMirror-linenumber { 71 color: var(--theme-body-background); 72 } 73 74 .debug-line .CodeMirror-linenumber { 75 background-color: var(--breakpoint-active-color); 76 } 77 78 .theme-dark .debug-line .CodeMirror-linenumber { 79 color: #c0c0c0; 80 } 81 82 .debug-line .CodeMirror-line { 83 background-color: var(--breakpoint-active-color) !important; 84 } 85 86 /* Don't display the highlight color since the debug line 87 is already highlighted */ 88 .debug-line .CodeMirror-activeline-background { 89 display: none; 90 } 91 92 .CodeMirror { 93 cursor: text; 94 height: 100%; 95 } 96 97 .CodeMirror-gutters { 98 cursor: default; 99 } 100 101 .cm-s-mozilla .CodeMirror-gutters, 102 .cm-editor .cm-gutters { /* vertical line next to line numbers */ 103 border-right-color: var(--gutter-border-color); 104 background-color: var(--gutter-background-color); 105 } 106 107 .cm-trailingspace { 108 background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg=="); 109 opacity: 0.75; 110 background-position: left bottom; 111 background-repeat: repeat-x; 112 } 113 114 /* Search highlight style 115 * cm-searching is used in Style Editor, cm-highlight in Debugger and searchMatch in Netmonitor */ 116 .cm-searching, 117 .cm-highlight, .cm-editor .cm-searchMatch { 118 border-bottom: 1px solid var(--theme-contrast-border); 119 /* Use the translucent yellow background, because we want the text selection 120 background (CodeMirror-selected) to show through this. */ 121 background-color: var(--theme-contrast-background-alpha); 122 123 :root[forced-colors-active] & { 124 border-bottom-width: 2px; 125 color: var(--theme-contrast-color); 126 } 127 } 128 129 /* CodeMirror 5 search addon input */ 130 .cm5-search-container { 131 display: flex; 132 padding: 4px 2px; 133 134 .CodeMirror-dialog:has(> &) { 135 background-color: var(--theme-body-background); 136 /* remove padding on the dialog so it's easier to style the focus indicator */ 137 padding: 0; 138 } 139 140 .cm5-search-input { 141 margin-inline: 1em; 142 flex-grow: 1; 143 } 144 145 &:focus-within { 146 outline: var(--theme-focus-outline); 147 outline-offset: -2px; 148 } 149 } 150 151 .cm5-search-replace-input { 152 width: 10em; 153 154 &:focus { 155 outline: var(--theme-focus-outline) !important; 156 } 157 } 158 159 .cm5-search-replace-hint { 160 color: var(--theme-text-color-alt); 161 margin-inline-start: 8px; 162 } 163 164 /* CodeMirror 5 vim addon prompt/input */ 165 .cm5-vim-prompt { 166 font-family: monospace; 167 white-space: pre; 168 169 /* When there's a label, add some space before the input */ 170 & label input { 171 margin-inline-start: 8px; 172 } 173 174 & input:focus { 175 outline: var(--theme-focus-outline) !important; 176 } 177 } 178 179 .cm5-vim-prompt-description { 180 color: var(--theme-text-color-alt); 181 margin-inline-start: 8px; 182 } 183 184 .cm5-vim-notification-error { 185 color: var(--theme-text-color-error); 186 } 187 188 /* CodeMirror dialogs styling */ 189 190 .CodeMirror-dialog { 191 padding: 4px 3px; 192 } 193 194 .CodeMirror-dialog, 195 .CodeMirror-dialog input { 196 font: message-box; 197 } 198 199 /* Fold addon */ 200 201 .CodeMirror-foldmarker { 202 display: inline-block; 203 font-family: sans-serif; 204 line-height: 10px; 205 margin: 0 1px; 206 padding: 0 2px; 207 border-radius: 3px; 208 border: solid 1px var(--theme-splitter-color); 209 color: var(--theme-body-color); 210 background-color: var(--theme-sidebar-background); 211 cursor: pointer; 212 } 213 214 .CodeMirror-foldgutter { 215 width: 16px; /* Same as breakpoints gutter above */ 216 } 217 218 .CodeMirror-foldgutter-open, 219 .CodeMirror-foldgutter-folded { 220 height: 14px; 221 margin-top: 1px; 222 background-image: url("chrome://devtools/skin/images/arrow.svg"); 223 background-position: center; 224 background-repeat: no-repeat; 225 -moz-context-properties: fill; 226 fill: var(--theme-icon-dimmed-color); 227 /* make the icons smaller than regular twistys (10->8px) */ 228 background-size: 8px; 229 cursor: pointer; 230 } 231 232 .CodeMirror-foldgutter-folded { 233 transform: rotate(-90deg); 234 } 235 236 .CodeMirror-hints { 237 position: absolute; 238 z-index: 10; 239 overflow: hidden; 240 list-style: none; 241 margin: 0; 242 padding: 2px; 243 border-radius: 3px; 244 font-size: 90%; 245 max-height: 20em; 246 overflow-y: auto; 247 } 248 249 .CodeMirror-hint { 250 margin: 0; 251 padding: 0 4px; 252 border-radius: 2px; 253 max-width: 19em; 254 overflow: hidden; 255 white-space: pre; 256 cursor: pointer; 257 } 258 259 .CodeMirror-Tern-completion { 260 padding-inline-start: 22px; 261 position: relative; 262 line-height: 18px; 263 } 264 265 .CodeMirror-Tern-completion:before { 266 position: absolute; 267 left: 2px; 268 bottom: 2px; 269 border-radius: 50%; 270 font-size: 12px; 271 font-weight: bold; 272 height: 15px; 273 width: 15px; 274 line-height: 16px; 275 text-align: center; 276 color: #ffffff; 277 box-sizing: border-box; 278 } 279 280 .CodeMirror-Tern-completion-unknown:before { 281 content: "?"; 282 } 283 284 .CodeMirror-Tern-completion-object:before { 285 content: "O"; 286 } 287 288 .CodeMirror-Tern-completion-fn:before { 289 content: "F"; 290 } 291 292 .CodeMirror-Tern-completion-array:before { 293 content: "A"; 294 } 295 296 .CodeMirror-Tern-completion-number:before { 297 content: "N"; 298 } 299 300 .CodeMirror-Tern-completion-string:before { 301 content: "S"; 302 } 303 304 .CodeMirror-Tern-completion-bool:before { 305 content: "B"; 306 } 307 308 .CodeMirror-Tern-completion-guess { 309 color: #999; 310 } 311 312 .CodeMirror-Tern-tooltip { 313 border-radius: 3px; 314 padding: 2px 5px; 315 white-space: pre-wrap; 316 max-width: 40em; 317 position: absolute; 318 z-index: 10; 319 } 320 321 .CodeMirror-Tern-hint-doc { 322 max-width: 25em; 323 } 324 325 .CodeMirror-Tern-farg-current { 326 text-decoration: underline; 327 } 328 329 .CodeMirror-Tern-fhint-guess { 330 opacity: .7; 331 } 332 333 /* Override the background-color: white applied to filler elements in codemirror.css */ 334 .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 335 appearance: auto; 336 -moz-default-appearance: scrollcorner; 337 } 338 339 /* Markup view and Event tooltip styles */ 340 341 .CodeMirror.cm-s-markup-view pre { 342 font-size: var(--theme-code-font-size); 343 line-height: var(--theme-code-line-height); 344 min-height: 15px; 345 } 346 347 /* Make our own cursor-blink animation */ 348 @keyframes cursor-blink { 349 0% {} 350 50% { opacity: 0; } 351 100% {} 352 } 353 354 .CodeMirror-focused .CodeMirror-cursor { 355 /* 356 * We're using the --caret-blink-time custom property for the animation duration. 357 * It is set in editor.js when we setup the CodeMirror instance, and will map either 358 * to the value of the ui.caretBlinkTime preference, or to CodeMirror's default for 359 * cursorBlinkRate. (See Bug 1609567 for more information on why this is needed). 360 */ 361 /* 362 * The animation should only be set when the editor is focused, otherwise the 363 * animation will continue even when devtools is in a background tab. 364 * This happens because the cursor is hidden using visiblity: hidden rather than 365 * display: none in codemirror.css. See bug 1661054 for details. 366 */ 367 animation: cursor-blink calc(var(--caret-blink-time, 0.53s) * 2) steps(1) infinite; 368 } 369 370 371 /* 372 * Always align CodeMirror lines to the left. 373 * See Bug 1651443 for more information. 374 */ 375 .CodeMirror-lines { 376 text-align: left; 377 } 378 379 /* CodeMirror matchhighlight styling */ 380 .cm-matchhighlight, .cm-searchMatch-selected { 381 outline: 1px solid var(--theme-contrast-border); 382 border-radius: 2px; 383 /* Override cm6 inline */ 384 background-color: transparent !important; 385 } 386 387 /* Make the outline a bit more visible in High Contrast Mode */ 388 :root[forced-colors-active] .cm-matchhighlight { 389 outline-width: 2px; 390 outline-offset: 2px; 391 } 392 393 .cm-non-printable-char { 394 color: var(--theme-comment); 395 font-size: 0.9em; 396 border-radius: 2px; 397 outline: 1px solid currentColor; 398 margin-inline: 2px; 399 padding-inline: 2px; 400 } 401 402 /* matching brackets highlight */ 403 .cm-s-mozilla .CodeMirror-matchingbracket, 404 /* Codemirror 6 */ 405 .cm-editor .cm-matchingBracket { 406 text-decoration: 1px underline solid currentColor; 407 text-decoration-skip-ink: none; 408 text-underline-offset: 3px; 409 } 410 411 .cm-s-mozilla.CodeMirror-focused .CodeMirror-selected { /* selected text (focused) */ 412 background: var(--theme-text-selection-background); 413 } 414 415 .cm-s-mozilla .CodeMirror-selected { /* selected text (unfocused) */ 416 background: var(--theme-text-selection-unfocused-background); 417 } 418 419 /* cm5 High Contrast Mode override */ 420 :root[forced-colors-active] { 421 .CodeMirror-selectedtext { 422 /* Set the color on the actual span elements */ 423 color: var(--theme-text-selection-color); 424 /* We also need to set the background color to avoid the backplating and keep it readable */ 425 background-color: var(--theme-text-selection-background); 426 427 /* Set the background for the "active match" (i.e. when double clicking a word) */ 428 &.cm-matchhighlight { 429 forced-color-adjust: auto; 430 background-color: var(--theme-text-selection-background) !important; 431 color: var(--theme-text-selection-color); 432 } 433 } 434 435 /* Matching brackets */ 436 div.CodeMirror span.CodeMirror-matchingbracket { 437 background-color: Mark; 438 color: MarkText; 439 } 440 } 441 442 /****************************************/ 443 /***** CodeMirror 6 specific styles *****/ 444 /****************************************/ 445 446 .cm-editor { 447 max-height: 100%; 448 height: 100%; 449 } 450 451 /* This makes sure we use the font-family set for devtools */ 452 .cm-editor .cm-scroller { 453 font-family: unset; 454 } 455 456 /* Remove the default selection match background, as search results might have the 457 .cm-selectionMatch class after the current search term has been removed, these should not be styled`` */ 458 .cm-editor .cm-selectionMatch { 459 background-color: transparent; 460 } 461 462 .cm-editor .cm-selectionBackground { 463 background: var(--theme-text-selection-background) !important; 464 } 465 466 .cm-editor .cm-content ::selection { 467 /* We don't want forced colors on selection so we can adjust the colors as we want. 468 This especially helps for the unfocused selected text */ 469 forced-color-adjust: none; 470 color: inherit; 471 } 472 473 .cm-editor .cm-line ::selection { 474 color: inherit; 475 } 476 477 :root[forced-colors-active] .cm-editor .cm-line ::selection, 478 :root[forced-colors-active] .cm-editor .cm-line::selection { 479 background-color: var(--theme-text-selection-background) !important; 480 color: var(--theme-text-selection-color) !important; 481 } 482 483 .cm6-dt-foldgutter__toggle-button { 484 height: 20px; 485 width: 20px; 486 padding-inline: 3px; 487 /* By default, the icon is a bit too low */ 488 translate: 0px -4px; 489 background-image: url("chrome://devtools/skin/images/arrow.svg"); 490 background-position: center; 491 background-repeat: no-repeat; 492 background-color: transparent; 493 border: none; 494 outline-offset: -2px; 495 -moz-context-properties: fill; 496 fill: var(--theme-icon-dimmed-color); 497 /* make the icons smaller than regular twistys (10->8px) */ 498 background-size: 8px; 499 cursor: pointer; 500 501 &[aria-expanded=false] { 502 transform: rotate(-90deg); 503 } 504 } 505 506 .cm-editor .cm-gutter.cm-lineNumbers { 507 user-select: none; 508 } 509 510 .cm-editor .cm-foldPlaceholder { 511 font-family: sans-serif; 512 padding: 0 2px; 513 border-radius: 3px; 514 border: solid 1px var(--theme-splitter-color); 515 color: var(--theme-body-color); 516 background-color: var(--theme-sidebar-background); 517 vertical-align: middle; 518 } 519 520 /* Repeat .cm-matchingBracket to get a higher specificity than the default codemirror rule */ 521 .cm-editor .cm-matchingBracket.cm-matchingBracket { 522 /* Removing the default background color */ 523 background-color: unset; 524 /* Applying the same color that was set in cm5. Set the color on the parent so the 525 underline set on the parent has the correct color */ 526 color: #0b0; 527 528 :root[forced-colors-active] & { 529 background-color: Mark; 530 color: MarkText; 531 } 532 533 .tok-punctuation { 534 color: currentColor; 535 } 536 } 537 538 .highlight-line .CodeMirror-line, 539 /* For CM6 */ 540 .cm-editor .cm-line.highlight-line { 541 animation-name: fade-highlight-out; 542 animation-duration: var(--highlight-line-duration); 543 animation-timing-function: ease-out; 544 animation-fill-mode: forwards; 545 } 546 547 @keyframes fade-highlight-out { 548 549 0%, 550 30% { 551 /* We want to use a color with some transparency so text selection is visible through it */ 552 background-color: var(--theme-contrast-background-alpha); 553 } 554 100% { 555 background-color: transparent; 556 } 557 } 558 559 .cm-editor .cm-panels { 560 background-color: var(--theme-toolbar-background); 561 color: var(--theme-body-color); 562 } 563 564 .cm-editor .cm-panels-top { 565 border-color: var(--theme-splitter-color); 566 } 567 568 /* Default search panel */ 569 .cm-search .cm-textfield { 570 width: 100%; 571 font-size: inherit; 572 background-color: transparent; 573 border-color: var(--theme-splitter-color); 574 margin: 0 !important; 575 } 576 577 /* Hide all other elements of the search except the text input */ 578 .cm-search .cm-button, .cm-search label, .cm-search button[name="close"] { 579 display: none; 580 }