1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
:root {
--markup-hidden-attr-color: light-dark(var(--grey-70), var(--grey-30));
--markup-hidden-punctuation-color: light-dark(var(--grey-50), var(--grey-40));
--markup-pseudoclass-disk-color: #e9c600;
--markup-hidden-tag-color: light-dark(var(--grey-50), var(--grey-45));
--markup-outline: light-dark(var(--theme-splitter-color), var(--theme-selection-background));
--markup-drag-line: light-dark(var(--grey-40), var(--grey-55));
--markup-drop-line: light-dark(var(--blue-55), var(--blue-50));
--markup-overflow-causing-background-color: light-dark(rgba(128, 0, 215, 0.15), rgba(148, 0, 255, 0.38));
--markup-new-attr-size: 2ch;
--markup-new-attr-focused-margin-inline: 1ch 2px;
--markup-selected-focus-visible-non-highlighted-color: light-dark(var(--theme-body-color), var(--theme-text-color-strong));
&[forced-colors-active] {
--markup-hidden-attr-color: GrayText;
--markup-hidden-punctuation-color: GrayText;
--markup-hidden-tag-color: GrayText;
/* In regular mode, this variable relies on --theme-body-color, which is already set
to CanvasText for HCM, BUT: we still need to force it here because of Bug 1917523 */
--markup-selected-focus-visible-non-highlighted-color: CanvasText;
--markup-drag-line: GrayText;
--markup-drop-line: SelectedItem;
}
}
* {
padding: 0;
margin: 0;
}
:root {
-moz-control-character-visibility: visible;
}
body {
user-select: none;
}
/* Force height and width (possibly overflowing) from inline elements.
* This allows long overflows of text or input fields to still be styled with
* the container, rather than the background disappearing when scrolling */
#root {
float: left; /* The markup view should always be LTR */
min-width: 100%;
box-sizing: border-box;
& > ul[role="tree"] {
/* Reserve extra space (in addition to the indent size) for DOM mutation
* breakpoint and pseudo icons. */
padding-inline-start: 6px;
outline-offset: -2px;
}
}
/* Reset the global rotation of the icon done for RTL layout.
Markup view is always LTR */
#root .theme-twisty:not(.open):dir(rtl),
#root .theme-twisty:not([open]):-moz-locale-dir(rtl) {
transform: rotate(-90deg);
}
/* Don't display a parent-child outline for the root elements */
#root > ul > li > .children {
background: none;
}
html.dragging {
overflow-x: hidden;
}
body.dragging .tag-line {
cursor: grabbing;
}
#root-wrapper:after {
content: "";
display: block;
clear: both;
position: relative;
}
.html-editor {
display: none;
position: absolute;
z-index: 2;
/* Use the same margin/padding trick used by .child tags to ensure that
* the editor covers up any content to the left (including expander arrows
* and hover effects). */
margin-left: -1000em;
padding-left: 1000em;
}
.html-editor-inner {
border: solid 0.1px;
flex: 1 1 auto;
/* Keep the editor away from the markup view floating scrollbars */
margin-inline-end: 12px;
}
.html-editor iframe {
height: 100%;
width: 100%;
border: none;
margin: 0;
padding: 0;
}
.children {
list-style: none;
padding: 0;
margin: 0;
}
/* Tags are organized in a UL/LI tree and indented thanks to a left padding.
* A very large padding is used in combination with a slightly smaller margin
* to make sure childs actually span from edge-to-edge. */
.child {
margin-left: -10000px;
padding-left: 10011px;
}
/* Normally this element takes space in the layout even if it's position: relative
* by adding height: 0 we let surrounding elements to fill the blank space */
.child.dragging {
position: relative;
pointer-events: none;
opacity: 0.7;
z-index: 1;
height: 0;
:root[forced-colors-active] & {
opacity: 1;
z-index: 2;
}
}
/* Indicates a tag-line in the markup-view as being an active drop target by
* drawing a horizontal line where the dragged element would be inserted if
* dropped here */
.tag-line.drop-target::before,
.tag-line.drag-target::before {
content: "";
position: absolute;
top: -1px;
height: 2px;
/* Offset these by 1000px to make sure they cover the full width of the view */
width: calc(100% + 1000px);
left: -1000px;
background-color: var(--markup-drag-line);
}
.tag-line.drop-target::before {
background-color: var(--markup-drop-line);
}
/* In case the indicator is put on the closing .tag-line, the indentation level
* will become misleading, so we push it forward to match the indentation level */
ul.children + .tag-line::before {
margin-left: 14px;
}
/* A tag line should have a height of 16px, with a line-height of 14px,
* (assuming a font-size of 11px). */
.tag-line {
font-size: var(--theme-code-font-size);
min-height: 1.2727em;
line-height: 1.2727em;
padding-block: 1px;
position: relative;
cursor: default;
}
/* Change selected line style when editing an attribute */
.tag-line[selected]:has(.styleinspector-propertyeditor:focus) .theme-selected {
background-color: var(--theme-body-alternate-emphasized-background);
color: unset;
/* revert the icon to the color it has when the line doesn't have the "selection" background */
& ~ .theme-twisty {
fill: var(--theme-icon-dimmed-color);
}
}
.tag-line[selected] + .children,
.tag-line[selected] ~ .tag-line {
background-image: linear-gradient(to top, var(--markup-outline), var(--markup-outline));
background-position: 0 0;
background-repeat: no-repeat;
background-size: 1.5px 100%;
padding-left: 8px;
margin-left: -8px;
}
.tag-line[selected] + .children {
background-position-y: 2px;
}
.tag-line[selected] ~ .tag-line {
background-position-y: -2px;
/* Unset transition-property to prevent the markup outline from horizontal shifting */
transition-property: none;
}
/**
* Positioning the mutation marker on the viewport's left edge:
* - left: walk back the indentation level up
* - margin-left: walk back the #root's 6px padding-left
* (plus hide the leftmost 2px of the icon outside the viewport)
*/
.markup-tag-mutation-marker {
display: none;
position: absolute;
top: 2px;
left: calc(var(--markup-level, 1) * -11px);
margin-left: -8px;
height: 12px;
width: 12px;
background-image: url(chrome://devtools/content/debugger/images/markup-breakpoint.svg);
background-repeat: no-repeat;
background-size: 12px 12px;
background-position: right center;
-moz-context-properties: fill, stroke;
fill: var(--blue-50);
fill-opacity: 1;
opacity: 1;
stroke: none;
z-index: 2;
}
.markup-tag-mutation-marker.has-mutations {
display: block;
}
.markup-tag-mutation-marker.has-mutations.mutation-breakpoint-disabled {
opacity: 0.6;
}
.tag-line[selected] .markup-tag-mutation-marker.mutation-breakpoint-disabled {
fill: #fff;
stroke: none;
}
.tag-line[selected] .markup-tag-mutation-marker {
stroke: #fff;
}
.html-editor-container {
position: relative;
min-height: 200px;
}
/* This extra element placed in each tag is positioned absolutely to cover the
* whole tag line and is used for background styling (when a selection is made
* or when the tag is flashing) */
.tag-line .tag-state {
position: absolute;
left: -1000em;
right: 0;
top: 0;
height: 100%;
z-index: 0;
}
.tag-line .tag-hover:not(.theme-selected) {
background: var(--theme-selection-background-hover);
z-index: -1;
}
.expander {
display: inline-block;
vertical-align: top;
width: 14px;
height: 16px;
margin: -1px 0 -1px -14px;
/* Make sure the expander still appears above the tag-state */
position: relative;
z-index: 1;
}
.child.collapsed .child,
.child.collapsed .children {
display: none;
}
.child > .tag-line:first-child .close {
display: none;
}
.child.collapsed > .tag-line:first-child .close {
display: inline;
}
.child.collapsed > .tag-line ~ .tag-line {
display: none;
}
.child.collapsed .close {
display: inline;
}
.expandable.collapsed .markup-expand-badge {
cursor: pointer;
display: inline-block;
vertical-align: top;
box-sizing: border-box;
height: 16px;
margin: -1px 0;
padding: 3px 2px;
}
.expandable.collapsed .markup-expand-badge::before {
/* Display an ellipsis character in collapsed nodes that can be expanded. */
content: "";
background-color: var(--badge-interactive-background-color);
background-image: url(chrome://devtools/skin/images/more.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 8px;
border: 1px solid var(--badge-interactive-border-color);
color: var(--badge-interactive-color);
fill: currentColor;
display: block;
width: 12px;
height: 8px;
line-height: 8px;
border-radius: 3px;
-moz-context-properties: fill;
}
.expandable.collapsed .markup-expand-badge:focus::before,
.expandable.collapsed .markup-expand-badge:hover::before {
background-color: var(--badge-hover-interactive-background-color);
color: var(--badge-hover-interactive-color);
}
/* Hide HTML void elements (img, hr, br, …) closing tag when the element is not
* expanded (it can be if it has pseudo-elements attached) */
.child.collapsed > .tag-line .void-element .close {
display: none;
}
.tag-line .tag-state.overflow-causing-highlighted:not(.theme-selected) {
background-color: var(--markup-overflow-causing-background-color);
}
/* Also display a small dot next to the overflow badge with the color of the
scroll badge. This makes us not rely solely on color to convey a state change,
as well as handle High Contrast Mode where the distinct background isn't visible */
.tag-state.overflow-causing-highlighted ~ .editor .inspector-badge.overflow-badge::before {
content: "";
display: inline-block;
width: 1ch;
aspect-ratio: 1 / 1;
margin-inline-end: 4px;
border-radius: 50%;
background-color: var(--badge-scrollable-active-background-color);
/* Use an outline to avoid impacting the layout more */
outline: 1px solid var(--badge-scrollable-active-color);
/* Opt out of forced colors so the dot is visible in High Contrast Mode */
forced-color-adjust: none;
}
.closing-bracket {
pointer-events: none;
}
.newattr {
/* Place the new attr "button" over the ">" char */
width: 1ch;
margin-inline-end: -1ch;
/* Make the button 1 char wide (it's easier to do it with a pseudo element as the element
is inline and we don't want to mess the vertical alignment) */
&::before {
content: "\00a0" / "";
}
&:focus-visible {
margin-inline: var(--markup-new-attr-focused-margin-inline);
background-image: url("chrome://devtools/skin/images/add.svg");
background-repeat: no-repeat;
background-size: 90%;
background-position: center;
-moz-context-properties: fill;
fill: var(--theme-icon-color);
/* When focused, make the button 2 chars wide */
&::before {
content: "\00a0\00a0" / "";
}
}
}
.attr-value .link {
text-decoration: underline;
}
.attr-value button.select-node {
display: inline-block;
vertical-align: middle;
height: 15px;
width: 15px;
/* small spacing between attribute name and the icon */
margin-inline-start: 2px;
/* prevent the icon from impacting node height */
margin-block-start: -2px;
padding: 0;
border: none;
background: url("chrome://devtools/skin/images/open-inspector.svg") no-repeat;
fill: var(--theme-icon-color);
-moz-context-properties: fill;
/* consistenty with the other buttons in the markup view */
cursor: pointer;
&:is(:hover, :focus) {
fill: var(--theme-icon-checked-color);
}
[role="treeitem"][aria-selected="true"] & {
fill: var(--theme-selection-color);
}
}
.flash-out {
transition:
background,
color 0.5s;
}
.editor {
/* Make sure the editor still appears above the tag-state */
position: relative;
z-index: 1;
}
.editor.comment:not(.doctype) {
color: var(--theme-highlight-green);
/* opt-out of forced color so comments gets a distinct color. This is safe as
--theme-highlight-green has a High Contrast specific declaration. */
forced-color-adjust: none;
}
.editor.text {
display: inline-block;
}
.editor.text pre,
.editor.comment pre {
font: inherit;
/* In the Markup view, the background color is set on .theme-selected, which is not
an ancestor of those <pre>, so we get backplating which doesn't play well with the
selected color. So for those, force the SelectedItem background color */
:root[forced-colors-active] .tag-line[selected] & {
background-color: SelectedItem;
}
}
/* Only override the color on non High Contrast dark theme so we can keep the inherited
colors in HCM */
:root.theme-dark:not([forced-colors-active]) .editor.text pre {
color: var(--theme-text-color-strong);
}
.more-nodes {
padding-left: 16px;
}
.styleinspector-propertyeditor {
vertical-align: top;
border: none;
&.newattr-input {
margin-inline: var(--markup-new-attr-focused-margin-inline);
/* Apply the same size as the new attr button so we don't shift the layout when dislaying the input */
min-width: var(--markup-new-attr-size);
}
}
.reveal-link {
cursor: pointer;
background: url("chrome://devtools/skin/images/reveal.svg") no-repeat;
display: inline-block;
width: 16px;
height: 8px;
-moz-context-properties: stroke;
stroke: currentColor;
}
/* Draw a circle next to nodes that have a pseudo class lock.
Center vertically with the 1.4em line height on .tag-line */
.child.pseudoclass-locked::before {
content: "";
background: var(--markup-pseudoclass-disk-color);
border-radius: 50%;
width: 6px;
height: 6px;
margin-top: 5px;
left: 8px;
position: absolute;
z-index: 1;
}
.not-displayed {
color: var(--markup-hidden-punctuation-color);
}
.not-displayed :is(.attr-name, .attr-value) {
color: var(--markup-hidden-attr-color);
}
.not-displayed .tag {
color: var(--markup-hidden-tag-color);
}
@layer markup-base {
.tag {
color: var(--theme-highlight-blue);
}
.attr-name {
color: var(--theme-highlight-red);
}
.attr-value {
color: var(--theme-highlight-purple);
}
.pseudo {
color: var(--theme-highlight-blue);
}
/* In High Contrast Mode, we need to override all the colors so we can properly handle
the selected + focused-visible style */
:root[forced-colors-active] :is(.tag, .pseudo) {
color: SelectedItem;
}
:root[forced-colors-active] .attr-name {
color: CanvasText;
}
:root[forced-colors-active] .attr-value {
/* opt-out of forced color so attribute values gets a distinct color. This is safe as
--theme-highlight-blue has a High Contrast specific declaration. */
forced-color-adjust: none;
color: var(--theme-highlight-blue);
}
}
/* Make focusable elements stand out a bit more when they're focused */
.tag-line :is(
[editable],
/* tag is not always editable (e.g. for `html`, `DOCTYPE`, …), but is always focusable */
.tag
):focus-visible {
border-radius: 2px;
outline: var(--theme-focus-outline);
outline-offset: var(--theme-outline-offset);
}
/* Selected nodes in the tree should have light selected text (unless there's an active
inplace editor input).
theme-selected doesn't work in this case since the text is a
sibling of the class, not a child. */
.tag-line[selected]:not(:has(.styleinspector-propertyeditor:focus)) :is(.editor, .editor.comment, .editor :is(.attr-name, .attr-value, .tag, .pseudo)) {
color: var(--theme-selection-color);
& :is([editable], .tag):focus-visible {
/* When an editable item in the markup view is focused, we want to make it stand out
Since the node is selected, we have a blue background on the whole node, so we set
the default body background, and set the original color we have when the line is
not selected.
This is done by using revert-layer, so we'll get colors set in <@layer markup-base>,
and not the one set in this rule's parent rule.
*/
color: revert-layer;
background-color: var(--theme-body-background);
outline-offset: 2px;
/* Better style for attributes spanning multiple lines */
box-decoration-break: clone;
mix-blend-mode: lighten;
.theme-dark & {
mix-blend-mode: darken;
}
/* We also need to take care of items that don't have their color set in <@layer markup-base> */
&:not(.attr-name, .attr-value, .tag, .pseudo) {
color: var(--markup-selected-focus-visible-non-highlighted-color);
}
& * {
color: revert-layer;
}
}
}
/* Selected nodes being flashed in the tree should have dark selected text. Here we target
nodes with theme-selected text colors and apply a dark, accessible text color for when
the yellow flashing background is applied. */
.tag-line[selected] :is(.theme-selected.theme-bg-contrast ~ .editor, .theme-selected ~ .editor .theme-fg-contrast) {
color: var(--theme-contrast-color) !important;
}
/* Applicable to the DOCTYPE */
.doctype {
font-style: italic;
}
|