App.css (16647B)
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 html, 6 body { 7 height: 100vh; 8 margin: 0; 9 padding: 0; 10 overflow: hidden; 11 } 12 13 #app-wrapper { 14 height: 100vh; 15 max-height: 100vh; 16 } 17 18 .webconsole-output { 19 direction: ltr; 20 overflow: auto; 21 overflow-anchor: none; 22 user-select: text; 23 position: relative; 24 container-name: console-output; 25 container-type: inline-size; 26 } 27 28 .webconsole-app { 29 --object-inspector-hover-background: transparent; 30 --attachment-margin-block-end: 3px; 31 --primary-toolbar-height: 29px; 32 display: grid; 33 /* 34 * Here's the design we want in in-line mode 35 * +----------------------------------------------+ 36 * | [ChromeDebugToolbar] | 37 * +----------------------------------------------+ 38 * | Filter bar primary ↔ | 39 * +----------------------------↔ | 40 * | [Filter bar secondary] ↔ | 41 * +----------------------------↔ | 42 * | ↔ | 43 * + +----------------------+ ↔ | 44 * | | | ↔ | 45 * | | Output | ↔ [sidebar] | 46 * | | | ↔ | 47 * | +----------------------+ ↔ | 48 * | | [NotificationBox] | ↔ | 49 * | +----------------------+ ↔ | 50 * | | | ↔ | 51 * | | JSTerm | ↔ | 52 * | | | ↔ | 53 * | +----------------------+ ↔ | 54 * | | [EagerEvaluation] | ↔ | 55 * | +----------------------+ ↔ | 56 * | | [EvalNotification] | ↔ | 57 * | +----------------------+ ↔ | 58 * +----------------------------↔ | 59 * | [Reverse search input] ↔ | 60 * +----------------------------------------------+ 61 * 62 * - ↔ are width resizers 63 * - Elements inside brackets may not be visible, so we set 64 * rows/columns to "auto" to make them collapse when the element 65 * they contain is hidden. 66 */ 67 grid-template-areas: 68 "chrome-debug-toolbar chrome-debug-toolbar" 69 "filter-toolbar sidebar" 70 "filter-toolbar-secondary sidebar" 71 "output-input sidebar" 72 "eval-notification sidebar" 73 "reverse-search sidebar"; 74 grid-template-rows: auto var(--primary-toolbar-height) auto 1fr auto auto; 75 grid-template-columns: minmax(200px, 1fr) minmax(0, auto); 76 max-height: 100vh !important; 77 height: 100vh !important; 78 width: 100vw; 79 overflow: hidden; 80 color: var(--console-output-color); 81 -moz-user-focus: normal; 82 } 83 84 .chrome-debug-toolbar { 85 grid-column: chrome-debug-toolbar; 86 grid-row: chrome-debug-toolbar; 87 } 88 89 .webconsole-filteringbar-wrapper { 90 grid-column: filter-toolbar; 91 grid-row: filter-toolbar / filter-toolbar-secondary; 92 grid-template-rows: subgrid; 93 } 94 95 .webconsole-filterbar-primary { 96 grid-row: filter-toolbar; 97 } 98 99 /* Only put the filter buttons toolbar on its own row in narrow filterbar layout */ 100 .narrow .devtools-toolbar.webconsole-filterbar-secondary { 101 grid-row: filter-toolbar-secondary; 102 } 103 104 .flexible-output-input { 105 display: flex; 106 flex-direction: column; 107 grid-area: output-input; 108 /* Don't take more height than the grid allows to */ 109 max-height: 100%; 110 overflow: hidden; 111 } 112 113 .flexible-output-input .webconsole-output { 114 flex-shrink: 100000; 115 overflow-x: hidden; 116 } 117 118 .flexible-output-input > .webconsole-output:not(:empty) { 119 min-height: var(--console-row-height); 120 } 121 122 /* webconsole.css | chrome://devtools/skin/webconsole.css */ 123 .webconsole-filteringbar-wrapper .devtools-toolbar { 124 padding-inline-end: 0; 125 } 126 127 .devtools-button.webconsole-console-settings-menu-button { 128 /* adjust outline offset so it's not clipped */ 129 --theme-outline-offset: -2px; 130 height: 100%; 131 margin: 0; 132 } 133 134 .webconsole-console-settings-menu-button::before { 135 background-image: url("chrome://devtools/skin/images/settings.svg"); 136 } 137 138 .webconsole-app .jsterm-input-container { 139 overflow-y: auto; 140 overflow-x: hidden; 141 /* We display the open editor button at the end of the input */ 142 display: grid; 143 grid-template-columns: 1fr auto; 144 /* This allows us to not define a column for the CodeMirror container */ 145 grid-auto-flow: column; 146 /* This element has tabindex="-1" and can briefly show a focus outline when 147 * clicked, before we move the focus to CodeMirror. */ 148 outline: none; 149 } 150 151 .webconsole-app:not(.jsterm-editor) .jsterm-input-container { 152 direction: ltr; 153 /* Define the border width and padding as variables so that we can keep 154 * border-top-width, padding and min-height in sync. */ 155 --jsterm-border-width: 0; 156 --jsterm-padding-top: 0; 157 --jsterm-padding-bottom: 0; 158 min-height: calc(var(--console-row-height) + var(--jsterm-border-width) + var(--jsterm-padding-top) + var(--jsterm-padding-bottom)); 159 padding-top: var(--jsterm-padding-top); 160 padding-bottom: var(--jsterm-padding-bottom); 161 border-top-color: var(--theme-splitter-color); 162 border-top-width: var(--jsterm-border-width); 163 border-top-style: solid; 164 } 165 166 .webconsole-app .webconsole-output:not(:empty) ~ .jsterm-input-container { 167 --jsterm-border-width: 1px; 168 } 169 170 .webconsole-app:not(.jsterm-editor, .eager-evaluation) .jsterm-input-container { 171 /* The input should be full-height when eager evaluation is disabled. */ 172 flex-grow: 1; 173 --jsterm-padding-top: var(--console-input-extra-padding); 174 --jsterm-padding-bottom: var(--console-input-extra-padding); 175 } 176 177 .webconsole-app:not(.jsterm-editor).eager-evaluation .jsterm-input-container { 178 --jsterm-padding-top: var(--console-input-extra-padding); 179 } 180 181 .webconsole-input-openEditorButton { 182 /* adjust outline offset so it's not clipped */ 183 --theme-outline-offset: -2px; 184 height: var(--console-row-height); 185 margin: 0; 186 padding-block: 0; 187 } 188 189 .webconsole-input-buttons { 190 grid-column: -1 / -2; 191 display: flex; 192 align-items: flex-start; 193 } 194 195 :root:dir(rtl) .webconsole-input-openEditorButton { 196 transform: scaleX(-1); 197 } 198 199 .webconsole-input-openEditorButton::before { 200 background-image: url("chrome://devtools/skin/images/webconsole/editor.svg"); 201 } 202 203 .webconsole-app .reverse-search { 204 grid-area: reverse-search; 205 /* Those 2 next lines make it so the element isn't impacting the grid column size, but 206 will still take the whole available space. */ 207 width: 0; 208 min-width: 100%; 209 /* Let the reverse search buttons wrap to the next line */ 210 flex-wrap: wrap; 211 justify-content: end; 212 } 213 214 .sidebar { 215 display: grid; 216 grid-area: sidebar; 217 grid-template-rows: subgrid; 218 border-inline-start: 1px solid var(--theme-splitter-color); 219 background-color: var(--theme-sidebar-background); 220 width: 200px; 221 min-width: 150px; 222 max-width: 100%; 223 } 224 225 .sidebar-resizer { 226 grid-row: 1 / -1; 227 grid-column: -1 / -2; 228 } 229 230 .webconsole-sidebar-toolbar { 231 grid-row: 1 / 2; 232 min-height: 100%; 233 display: flex; 234 justify-content: end; 235 margin: 0; 236 padding: 0; 237 } 238 239 .sidebar-contents { 240 grid-row: 2 / -1; 241 overflow: auto; 242 direction: ltr; 243 } 244 245 .webconsole-sidebar-toolbar .sidebar-close-button { 246 margin: 0; 247 } 248 249 .sidebar-close-button::before { 250 background-image: url("chrome://devtools/skin/images/close.svg"); 251 } 252 253 .sidebar-contents .object-inspector { 254 min-width: 100%; 255 } 256 257 /** EDITOR MODE */ 258 .webconsole-app.jsterm-editor { 259 display: grid; 260 /* 261 * Here's the design we want in editor mode 262 * +-----------------------------------------------------------------------+ 263 * | [ChromeDebugToolbar] | 264 * +-----------------------------------------------------------------------+ 265 * | [Notification Box (self XSS warning)] | 266 * +--------------------------+--------------------------+-----------------+ 267 * | Editor Toolbar ↔ Filter bar primary ↔ | 268 * +--------------------------↔--------------------------↔ | 269 * | ↔ [Filter bar secondary] ↔ | 270 * | ↔--------------------------↔ | 271 * | ↔ ↔ | 272 * | Editor ↔ output ↔ [sidebar] | 273 * | ↔ ↔ | 274 * | ↔ ↔ | 275 * | ↔ ↔ | 276 * | ↔ ↔ | 277 * +--------------------------↔ ↔ | 278 * | [Eager evaluation] ↔ ↔ | 279 * +--------------------------↔ ↔ | 280 * | [Eval Notification] ↔ ↔ | 281 * +--------------------------↔ ↔ | 282 * | [Reverse search input] ↔ ↔ | 283 * +-----------------------------------------------------+-----------------+ 284 * 285 * - ↔ are width resizers 286 * - Elements inside brackets may not be visible, so we set 287 * rows/columns to "auto" to make them collapse when the element 288 * they contain is hidden. 289 */ 290 grid-template-areas: 291 "chrome-debug-toolbar chrome-debug-toolbar chrome-debug-toolbar" 292 "notification notification notification" 293 "editor-toolbar filter-toolbar sidebar" 294 "editor filter-toolbar-secondary sidebar" 295 "editor output sidebar" 296 "eager-evaluation output sidebar" 297 "eval-notification output sidebar" 298 "reverse-search output sidebar"; 299 grid-template-rows: 300 auto 301 auto 302 var(--primary-toolbar-height) 303 auto 304 1fr 305 auto 306 auto 307 auto; 308 grid-template-columns: minmax(150px, auto) minmax(200px, 1fr) minmax(0, auto); 309 } 310 311 .jsterm-editor .flexible-output-input { 312 /* This allow us to place the div children (jsterm, output, notification) on the grid */ 313 display: contents; 314 } 315 316 .jsterm-editor .webconsole-editor-toolbar { 317 grid-area: editor-toolbar; 318 border-inline-end: 1px solid var(--theme-splitter-color); 319 display: grid; 320 align-items: center; 321 /* 322 * The following elements are going to be present in the toolbar: 323 * - The run button 324 * - The evaluation selector button 325 * - The pretty print button 326 * - A separator 327 * - The history nav 328 * - A separator 329 * - The close button 330 * 331 * +-------------------------------------------+ 332 * | ▶︎ Run Top↕ {} | ˄ ˅ 🔍 | ✕ | 333 * +-------------------------------------------+ 334 * 335 */ 336 grid-template-columns: auto auto 1fr auto auto auto auto auto auto auto; 337 height: unset; 338 } 339 340 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-executeButton { 341 padding-inline: 4px 8px; 342 height: 20px; 343 margin-inline-start: 5px; 344 display: flex; 345 align-items: center; 346 } 347 348 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-executeButton::before { 349 content: url("chrome://devtools/skin/images/webconsole/run.svg"); 350 height: 16px; 351 width: 16px; 352 -moz-context-properties: fill; 353 fill: currentColor; 354 margin-inline-end: 2px; 355 } 356 357 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-prettyPrintButton { 358 grid-column: -7 / -8; 359 } 360 361 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-prettyPrintSeparator { 362 grid-column: -6 / -7; 363 } 364 365 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-history-prevExpressionButton { 366 grid-column: -5 / -6; 367 } 368 369 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-history-nextExpressionButton { 370 grid-column: -4 / -5; 371 } 372 373 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-reverseSearchButton { 374 grid-column: -3 / -4; 375 } 376 377 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-historyNavSeparator { 378 grid-column: -2 / -3; 379 } 380 381 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-closeButton { 382 grid-column: -1 / -2; 383 } 384 385 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-prettyPrintButton::before { 386 background-image: url("chrome://devtools/content/debugger/images/prettyPrint.svg"); 387 background-size: 16px; 388 fill: var(--theme-icon-color); 389 -moz-context-properties: fill; 390 } 391 392 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-history-prevExpressionButton::before { 393 background-image: url("chrome://devtools/skin/images/arrowhead-up.svg"); 394 background-size: 16px; 395 } 396 397 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-history-nextExpressionButton::before { 398 background-image: url("chrome://devtools/skin/images/arrowhead-down.svg"); 399 background-size: 16px; 400 } 401 402 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-reverseSearchButton::before { 403 background-image: url("chrome://devtools/skin/images/webconsole/reverse-search.svg"); 404 background-size: 14px; 405 } 406 407 .jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-closeButton::before { 408 background-image: url("chrome://devtools/skin/images/close.svg"); 409 } 410 411 .jsterm-editor .webconsole-input-openEditorButton { 412 display: none; 413 } 414 415 .jsterm-editor .webconsole-output { 416 grid-area: output; 417 } 418 419 .jsterm-editor .jsterm-input-container { 420 grid-area: editor; 421 width: 30vw; 422 /* Don't allow the input to be narrower than the grid-column it's in */ 423 min-width: 100%; 424 border-top: none; 425 border-inline-end: 1px solid var(--theme-splitter-color); 426 padding: 0; 427 /* Needed as we might have the onboarding UI displayed */ 428 display: flex; 429 flex-direction: column; 430 background-color: var(--theme-sidebar-background); 431 } 432 433 .jsterm-editor #webconsole-notificationbox { 434 grid-area: notification; 435 } 436 437 .jsterm-editor .jsterm-input-container > .CodeMirror { 438 flex: 1; 439 padding-inline-start: 0; 440 font-size: var(--theme-code-font-size); 441 line-height: var(--theme-code-line-height); 442 background-image: none; 443 } 444 445 .jsterm-editor .eager-evaluation-result { 446 grid-area: eager-evaluation; 447 /* The next 2 lines make it so the element isn't impacting the grid column size, but 448 will still take the whole available space. */ 449 min-width: 100%; 450 width: 0; 451 } 452 453 .evaluation-notification { 454 grid-area: eval-notification; 455 /* The next 2 lines make it so the element isn't impacting the grid column size, but 456 will still take the whole available space. */ 457 min-width: 100%; 458 width: 0; 459 border: 1px solid; 460 display: flex; 461 padding: 0.5em; 462 } 463 464 .jsterm-editor .editor-resizer { 465 grid-column: editor; 466 /* We want the splitter to cover the whole column (minus self-xss message) */ 467 grid-row: editor / reverse-search; 468 } 469 470 .editor-onboarding { 471 display: none; 472 } 473 474 .jsterm-editor .editor-onboarding { 475 display: grid; 476 /** 477 * Here's the design we want: 478 * ┌──────┬────────────────────────┐ 479 * │ Icon │ Onboarding text │ 480 * ├──────┼────────────────────────┤ 481 * │ │ Got it!│ 482 * └──────┴────────────────────────┘ 483 **/ 484 grid-template-columns: 22px 1fr; 485 border-bottom: 1px solid var(--theme-splitter-color); 486 padding: 8px 16px; 487 background-color: var(--theme-body-alternate-emphasized-background); 488 grid-gap: 0 14px; 489 font-family: system-ui; 490 font-size: 12px; 491 line-height: 1.5; 492 } 493 494 .editor-onboarding-fox { 495 width: 22px; 496 height: 22px; 497 align-self: center; 498 } 499 500 .jsterm-editor .editor-onboarding p { 501 padding: 0; 502 margin: 0; 503 } 504 505 .jsterm-editor .editor-onboarding .editor-onboarding-shortcut { 506 font-weight: bold; 507 } 508 509 .editor-onboarding-dismiss-button { 510 grid-row: 2 / 3; 511 grid-column: 2 / 3; 512 justify-self: end; 513 padding: 2px; 514 background: transparent; 515 border: none; 516 color: var(--theme-link-color); 517 font-family: inherit; 518 cursor: pointer; 519 font-size: inherit; 520 }