gecko-dev/devtools/client/themes/markup.css

465 lines
11 KiB
CSS

/* 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-badge-active-background-color: var(--blue-50);
--markup-badge-active-border-color: #FFFFFFB3;
--markup-badge-background-color: white;
--markup-badge-border-color: #CACAD1;
--markup-badge-color: var(--grey-60);
--markup-badge-hover-background-color: #DFDFE8;
--markup-badge-interactive-background-color: var(--grey-20);
--markup-badge-interactive-color: var(--grey-90);
--markup-hidden-attr-name-color: #BA89B8;
--markup-hidden-attr-value-color: #5C6D87;
--markup-hidden-punctuation-color: #909090;
--markup-hidden-tag-color: #97A4B3;
--markup-outline: var(--theme-splitter-color);
}
.theme-dark:root {
--markup-badge-active-background-color: var(--blue-60);
--markup-badge-active-border-color: #FFF6;
--markup-badge-background-color: var(--grey-80);
--markup-badge-border-color: var(--grey-50);
--markup-badge-color: var(--grey-40);
--markup-badge-hover-background-color: var(--grey-80);
--markup-badge-interactive-background-color: var(--grey-70);
--markup-badge-interactive-color: var(--grey-30);
--markup-hidden-attr-name-color: #B07EB3;
--markup-hidden-attr-value-color: #9893A3;
--markup-hidden-punctuation-color: #909090;
--markup-hidden-tag-color: #AFB5BF;
--markup-outline: var(--theme-selection-background);
}
* {
padding: 0;
margin: 0;
}
:root {
-moz-control-character-visibility: visible;
}
body {
-moz-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;
min-width: 100%;
}
/* 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 .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: -1000em;
padding-left: 1001em;
}
/* 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;
}
/* 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: 0;
width: 100%;
/* Offset these by 1000px to make sure they cover the full width of the view */
padding-left: 1000px;
left: -1000px;
}
.tag-line.drag-target::before {
border-top: 2px solid var(--theme-content-color2);
}
.tag-line.drop-target::before {
border-top: 2px solid var(--theme-contrast-background);
}
/* 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;
}
.tag-line {
min-height: 1.4em;
line-height: 1.4em;
position: relative;
cursor: default;
padding-left: 2px;
}
.tag-line[selected] + .children,
.tag-line[selected] ~ .tag-line {
background-image: linear-gradient(to top, var(--markup-outline), var(--markup-outline));
background-position-x: -6px;
background-repeat: no-repeat;
background-size: 1.5px 100%;
border-left: 6px solid transparent;
margin-left: -6px;
}
.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;
}
.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;
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;
margin-left: -14px;
vertical-align: middle;
/* 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: -3px;
padding: 2px;
}
.expandable.collapsed .markup-expand-badge::before {
/* Display an ellipsis character in collapsed nodes that can be expanded. */
content: "";
background-color: var(--markup-badge-interactive-background-color);
background-image: url(chrome://devtools/skin/images/more.svg);
background-repeat: no-repeat;
background-position: center;
border: 1px solid var(--markup-badge-border-color);
color: var(--markup-badge-color);
fill: var(--markup-badge-interactive-color);
display: block;
width: 12px;
height: 8px;
line-height: 3px;
border-radius: 3px;
-moz-context-properties: fill;
}
/* 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;
}
.closing-bracket {
pointer-events: none;
}
.newattr {
margin-right: -13px;
}
.newattr:before {
content: "\00a0\00a0";
}
.attr-value .link {
text-decoration: underline;
}
.newattr:focus {
margin-right: 0;
}
.flash-out {
transition: background .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);
}
.editor.text {
display: inline-block;
}
.editor.text pre,
.editor.comment pre {
font: inherit;
}
.theme-dark .editor.text pre {
color: var(--theme-content-color1);
}
/* Whitespace only text nodes are sometimes shown in the markup-view, and when they do
they get a greyed-out whitespace symbol so users know what they are */
.editor.text .whitespace {
padding: 0 .5em;
}
.editor.text .whitespace::before {
/* black circle (full) character */
content: "\25cf";
display: inline-block;
width: 12px;
height: 8px;
margin: 0 2px;
line-height: 7px;
font-size: 0.6em;
color: var(--theme-body-color-inactive);
border-radius: 3px;
border-style: solid;
border-width: 1px;
text-align: center;
vertical-align: middle;
}
.tag-line[selected] .editor.text .whitespace::before {
color: white;
}
.more-nodes {
padding-left: 16px;
}
.styleinspector-propertyeditor {
border: 1px solid #CCC;
}
.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(--theme-highlight-lightorange);
border-radius: 50%;
width: .8em;
height: .8em;
margin-top: .3em;
left: 1px;
position: absolute;
z-index: 1;
}
.not-displayed {
color: var(--markup-hidden-punctuation-color);
}
.not-displayed .attr-name {
color: var(--markup-hidden-attr-name-color);
}
.not-displayed .attr-value {
color: var(--markup-hidden-attr-value-color);
}
.not-displayed .tag {
color: var(--markup-hidden-tag-color);
}
/* Selected nodes in the tree should have light selected text.
theme-selected doesn't work in this case since the text is a
sibling of the class, not a child. */
.theme-selected ~ .editor,
.theme-selected ~ .editor.comment,
.theme-selected ~ .editor .theme-fg-color1,
.theme-selected ~ .editor .theme-fg-color2,
.theme-selected ~ .editor .theme-fg-color3,
.theme-selected ~ .editor .theme-fg-color4,
.theme-selected ~ .editor .theme-fg-color5 {
color: var(--theme-selection-color);
}
/* Applicable to the DOCTYPE */
.doctype {
font-style: italic;
}
/* Markup Badges */
.markup-badge {
display: inline-block;
/* 9px text is too blurry on low-resolution screens */
font-size: 10px;
font-weight: normal;
line-height: 11px;
vertical-align: 0.5px;
border: 1px solid var(--markup-badge-border-color);
border-radius: 3px;
padding: 0px 2px;
margin-inline-start: 5px;
-moz-user-select: none;
background-color: var(--markup-badge-background-color);
color: var(--markup-badge-color);
}
@media (min-resolution: 1.1dppx) {
.markup-badge {
font-size: 9px;
vertical-align: 1px;
}
}
/* Markup badges that are interactive/clickable */
.markup-badge[data-custom],
.markup-badge[data-display="flex"].interactive,
.markup-badge[data-display="grid"],
.markup-badge[data-display="inline-flex"],
.markup-badge[data-display="inline-grid"],
.markup-badge[data-event] {
background-color: var(--markup-badge-interactive-background-color);
color: var(--markup-badge-interactive-color);
cursor: pointer;
}
.markup-badge[data-display="flex"]:not(.active).interactive:focus,
.markup-badge[data-display="flex"]:not(.active).interactive:hover,
.markup-badge[data-display="grid"]:not(.active):focus,
.markup-badge[data-display="grid"]:not(.active):hover,
.markup-badge[data-display="inline-flex"]:not(.active).interactive:focus,
.markup-badge[data-display="inline-flex"]:not(.active).interactive:hover,
.markup-badge[data-display="inline-grid"]:not(.active):focus,
.markup-badge[data-display="inline-grid"]:not(.active):hover,
.markup-badge[data-event]:focus,
.markup-badge[data-event]:hover,
.expandable.collapsed .markup-expand-badge:focus::before,
.expandable.collapsed .markup-expand-badge:hover::before {
background-color: var(--markup-badge-hover-background-color);
}
.markup-badge.active,
.markup-badge.interactive.active {
background-color: var(--markup-badge-active-background-color);
border-color: var(--markup-badge-active-border-color);
color: var(--theme-selection-color);
}