Editor.css (5164B)
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 .editor-wrapper { 6 --debug-expression-background: rgba(202, 227, 255, 0.5); 7 --debug-line-error-border: rgb(255, 0, 0); 8 --debug-expression-error-background: rgba(231, 116, 113, 0.3); 9 --line-exception-background: hsl(344, 73%, 97%); 10 } 11 12 .theme-dark .editor-wrapper { 13 --debug-expression-background: rgba(202, 227, 255, 0.3); 14 --line-exception-background: hsl(345, 23%, 24%); 15 } 16 17 .editor-wrapper .CodeMirror-linewidget { 18 margin-right: -7px; 19 } 20 21 .editor-wrapper { 22 min-width: 0 !important; 23 } 24 25 .CodeMirror.cm-s-mozilla, 26 .CodeMirror-scroll, 27 .CodeMirror-sizer { 28 overflow-anchor: none; 29 } 30 31 /* Prevents inline preview from shifting source height (#1576163) */ 32 .CodeMirror-linewidget { 33 padding: 0; 34 display: flow-root; 35 } 36 37 /** 38 * There's a known codemirror flex issue with chrome that this addresses. 39 * BUG https://github.com/firefox-devtools/debugger/issues/63 40 */ 41 .editor-wrapper { 42 width: calc(100% - 1px); 43 overflow-y: auto; 44 grid-area: editor; 45 } 46 47 html[dir="rtl"] .editor-mount { 48 direction: ltr; 49 } 50 51 .function-search { 52 max-height: 300px; 53 overflow: hidden; 54 } 55 56 .function-search .results { 57 height: auto; 58 } 59 60 .editor.hit-marker { 61 height: 15px; 62 } 63 64 .editor-wrapper .highlight-lines { 65 background: var(--theme-selection-background-hover); 66 } 67 68 .CodeMirror { 69 width: 100%; 70 height: 100%; 71 } 72 73 .editor-wrapper .editor-mount { 74 width: 100%; 75 background-color: var(--theme-body-background); 76 font-size: var(--theme-code-font-size); 77 line-height: var(--theme-code-line-height); 78 } 79 80 .theme-dark .editor-wrapper .CodeMirror-line .cm-comment { 81 color: var(--theme-comment); 82 } 83 84 /* Is debug-expression is only used in CM5? */ 85 .debug-expression { 86 background-color: var(--debug-expression-background); 87 border-style: solid; 88 border-color: var(--debug-expression-background); 89 border-width: 1px 0 1px 0; 90 position: relative; 91 } 92 93 .debug-expression::before { 94 content: ""; 95 line-height: 1px; 96 border-top: 1px solid var(--blue-50); 97 background: transparent; 98 position: absolute; 99 top: -2px; 100 left: 0; 101 width: 100%; 102 } 103 104 .debug-expression::after { 105 content: ""; 106 line-height: 1px; 107 border-bottom: 1px solid var(--blue-50); 108 position: absolute; 109 bottom: -2px; 110 left: 0; 111 width: 100%; 112 } 113 114 /** 115 * This is the "paused" caret displaying at what particular column we are currently paused. 116 */ 117 .paused-location { 118 position: relative; 119 width: 1px; 120 height: 1.2em; 121 margin-bottom: -0.2em; 122 display: inline-block; 123 124 .triangle { 125 position: absolute; 126 left: -6px; 127 right: 0; 128 top: -1px; 129 bottom: 0; 130 display: inline-block; 131 width: 1em; 132 height: 1em; 133 134 &.first-column { 135 /* When the caret is set on the first non-space column, 136 we can shift it further on the left empty space 137 in order to prevent shifting the code content. 138 Also shift the caret one pixel closer to the token (-3 to -4px right) 139 in order to avoid showing too far right when on the very first column. */ 140 margin-left: -7px; 141 margin-right: -4px; 142 } 143 144 .column-breakpoint + &.first-column { 145 /* When the caret is on the first column, but there is a column breakpoint displayed before 146 reset back the first-column margins as we may display the caret over the breakpoint marker. */ 147 margin-left: -4px; 148 margin-right: -4px; 149 } 150 151 background-image: url("chrome://devtools/skin/images/dropmarker.svg"); 152 background-repeat: no-repeat; 153 background-position: center top; 154 background-size: 100%; 155 -moz-context-properties: fill; 156 fill: var(--paused-line-border); 157 } 158 } 159 160 .to-line-end ~ .CodeMirror-widget { 161 background-color: var(--debug-expression-background); 162 } 163 164 .debug-expression-error { 165 background-color: var(--debug-expression-error-background); 166 } 167 168 .new-debug-line-error > .CodeMirror-line, 169 /* For CM6 */ 170 .cm-editor .cm-line.new-debug-line-error { 171 background-color: var(--debug-expression-error-background) !important; 172 outline: var(--debug-line-error-border) solid 1px; 173 } 174 175 /* Don't display the highlight color since the debug line 176 is already highlighted */ 177 .new-debug-line-error .CodeMirror-activeline-background { 178 display: none; 179 } 180 181 .visible { 182 visibility: visible; 183 } 184 185 /* Code folding */ 186 .editor-wrapper .CodeMirror-foldgutter-open { 187 color: var(--grey-40); 188 } 189 190 .editor-wrapper .CodeMirror-foldgutter-open, 191 .editor-wrapper .CodeMirror-foldgutter-folded { 192 fill: var(--grey-40); 193 } 194 195 .editor-wrapper .CodeMirror-foldgutter-open::before, 196 .editor-wrapper .CodeMirror-foldgutter-open::after { 197 border-top: none; 198 } 199 200 .editor-wrapper .CodeMirror-foldgutter-folded::before, 201 .editor-wrapper .CodeMirror-foldgutter-folded::after { 202 border-left: none; 203 } 204 205 .editor-wrapper .CodeMirror-foldgutter .CodeMirror-linenumber { 206 text-align: left; 207 padding: 0 0 0 2px; 208 } 209 210 /* Exception line */ 211 .line-exception { 212 background-color: var(--line-exception-background); 213 } 214 215 .mark-text-exception { 216 text-decoration: var(--red-50) wavy underline; 217 text-decoration-skip-ink: none; 218 }