gecko-dev/devtools/client/themes/common.css
2018-08-30 02:59:32 +00:00

850 lines
21 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/. */
@import url("resource://devtools/client/themes/splitters.css");
@namespace html url("http://www.w3.org/1999/xhtml");
:root {
font: message-box;
--clear-icon-url: url("chrome://devtools/skin/images/clear.svg");
--tab-line-hover-color: rgba(0,0,0,.2);
--tab-line-selected-color: var(--blue-50);
--toggle-thumb-color: white;
--toggle-track-color: var(--grey-30);
}
:root.theme-dark {
--tab-line-hover-color: rgba(255,255,255,.2);
--toggle-thumb-color: var(--grey-40);
--toggle-track-color: var(--grey-60);
}
:root[platform="mac"] {
--monospace-font-family: Menlo, monospace;
}
:root[platform="win"] {
--monospace-font-family: Consolas, monospace;
}
:root[platform="linux"] {
--monospace-font-family: monospace;
}
.devtools-monospace {
font-family: var(--monospace-font-family);
}
:root[platform="linux"] .devtools-monospace {
font-size: 11px;
}
/* Override wrong system font from forms.css */
html|button, html|select {
font: message-box;
}
/* Autocomplete Popup */
.devtools-autocomplete-popup {
overflow: hidden;
/* Devtools autocompletes display technical english keywords and should be displayed
using LTR direction. */
direction: ltr !important;
}
/* Reset list styles. */
.devtools-autocomplete-popup ul {
list-style: none;
}
.devtools-autocomplete-popup ul,
.devtools-autocomplete-popup li {
margin: 0;
}
:root[platform="linux"] .devtools-autocomplete-listbox {
/* Root font size is bigger on Linux, adjust rem-based values. */
max-height: 16rem;
}
.devtools-autocomplete-listbox {
--autocomplete-item-padding-inline: 8px;
-moz-appearance: none !important;
background-color: transparent;
border-width: 0px !important;
margin: 0;
padding: 0;
overflow-x: hidden;
max-height: 20rem;
height: 100%;
box-sizing: border-box;
}
.devtools-autocomplete-listbox .autocomplete-item {
width: 100%;
background-color: transparent;
color: var(--theme-popup-color);
padding: 1px var(--autocomplete-item-padding-inline);
cursor: default;
text-overflow: ellipsis;
white-space: pre;
overflow: hidden;
}
.devtools-autocomplete-listbox .autocomplete-item > .initial-value,
.devtools-autocomplete-listbox .autocomplete-item > .autocomplete-value {
margin: 0;
padding: 0;
float: left;
}
.devtools-autocomplete-listbox .autocomplete-item > .autocomplete-postlabel {
font-style: italic;
float: right;
padding-right: 3px;
}
.devtools-autocomplete-listbox .autocomplete-item > .autocomplete-count {
text-align: end;
}
.devtools-autocomplete-listbox .autocomplete-swatch {
cursor: pointer;
border-radius: 50%;
width: 1em;
height: 1em;
vertical-align: middle;
/* align the swatch with its value */
margin-top: -1px;
margin-inline-end: 5px;
display: inline-block;
position: relative;
}
.devtools-autocomplete-listbox .autocomplete-colorswatch::before {
content: '';
background-color: #eee;
background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
background-size: 12px 12px;
background-position: 0 0, 6px 6px;
position: absolute;
border-radius: 50%;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
/* Rest of the dark and light theme */
.devtools-autocomplete-popup,
.tooltip-panel.devtools-autocomplete-popup,
.CodeMirror-hints,
.CodeMirror-Tern-tooltip {
border: 1px solid var(--theme-popup-border-color);
background-color: var(--theme-popup-background);
color: var(--theme-popup-color);
}
.devtools-autocomplete-listbox .autocomplete-item:hover {
background-color: var(--theme-popup-dimmed);
}
.devtools-autocomplete-listbox .autocomplete-selected,
.devtools-autocomplete-listbox .autocomplete-selected:hover {
background-color: var(--theme-selection-background);
color: var(--theme-selection-color);
}
.devtools-autocomplete-listbox .autocomplete-selected > .initial-value {
font-weight: bold;
}
/* Autocomplete list clone used for accessibility. */
.devtools-autocomplete-list-aria-clone {
/* Cannot use display:none or visibility:hidden : screen readers ignore the element. */
position: fixed;
overflow: hidden;
margin: 0;
width: 0;
height: 0;
}
.devtools-autocomplete-list-aria-clone li {
/* Prevent screen readers from prefacing every item with 'bullet'. */
list-style-type: none;
}
/* links to source code, like displaying `myfile.js:45` */
.devtools-source-link {
font-family: var(--monospace-font-family);
color: var(--theme-highlight-blue);
cursor: pointer;
white-space: nowrap;
display: flex;
text-decoration: none;
font-size: 11px;
width: 12em; /* probably should be changed for each tool */
}
.devtools-source-link:hover {
text-decoration: underline;
}
.devtools-source-link > .filename {
text-overflow: ellipsis;
text-align: end;
overflow: hidden;
margin: 2px 0px;
cursor: pointer;
}
.devtools-source-link > .line-number {
flex: none;
margin: 2px 0px;
cursor: pointer;
}
/* Keyboard focus highlight styles */
:-moz-focusring {
outline: var(--theme-focus-outline);
outline-offset: -1px;
}
textbox[focused="true"] {
border-color: var(--theme-focus-border-color-textbox);
box-shadow: var(--theme-focus-box-shadow-textbox);
transition: all 0.2s ease-in-out
}
textbox :-moz-focusring {
box-shadow: none;
outline: none;
}
/* Form fields should already have box-shadow hightlight */
select:-moz-focusring,
input[type="radio"]:-moz-focusring,
input[type="checkbox"]:-moz-focusring,
checkbox:-moz-focusring {
outline: none;
}
/* Tab and button of toolbox does not need to display outline */
.devtools-button:-moz-focusring,
.devtools-tab:-moz-focusring {
outline:none;
}
/* Toolbar buttons */
.devtools-menulist,
.devtools-toolbarbutton,
.devtools-button {
-moz-appearance: none;
background: transparent;
border: 1px solid var(--toolbarbutton-border-color);
border-radius: 2px;
color: var(--theme-body-color);
transition: background-color 0.05s ease-in-out;
-moz-box-align: center;
text-shadow: none;
padding: 1px;
margin: 1px;
/* Button text should not wrap on multiple lines */
white-space: nowrap;
}
/* Remove system form border from devtools-button. */
.devtools-button::-moz-focus-inner {
border: 0;
}
.devtools-toolbarbutton:not([label]) > .toolbarbutton-icon,
.devtools-button:empty::before {
width: 16px;
height: 16px;
margin: 0 3px;
transition: opacity 0.05s ease-in-out;
color: var(--theme-toolbar-color);
direction: ltr;
font-size: 11px;
}
.devtools-button:empty::before {
content: "";
display: inline-block;
background-repeat: no-repeat;
vertical-align: middle;
}
.devtools-button.checked:empty::before {
color: var(--theme-toolbar-checked-color);
}
/* Standalone buttons */
.devtools-button[standalone],
.devtools-button[data-standalone],
.devtools-toolbarbutton[standalone],
.devtools-toolbarbutton[data-standalone] {
border-color: rgba(138,161,180,0.2) !important;
min-height: 30px;
}
.devtools-toolbarbutton[standalone], .devtools-toolbarbutton[data-standalone] {
margin-inline-end: 5px;
}
/* Icon button styles */
.devtools-toolbarbutton:not([label]) > .toolbarbutton-text {
display: none;
}
/* Icon-only buttons */
.devtools-button:hover:empty:not(:disabled):before,
.devtools-button.checked:empty::before,
.devtools-toolbarbutton:not([label]):not([disabled=true]):hover > image,
.devtools-toolbarbutton:not([label])[checked=true] > image,
.devtools-toolbarbutton:not([label])[open=true] > image {
opacity: 1;
}
.devtools-button:disabled,
.devtools-toolbarbutton[disabled] {
opacity: 0.5 !important;
}
.devtools-button.checked::before,
.devtools-toolbarbutton:not([label])[checked=true] > image,
.devtools-toolbarbutton:not([label])[open=true] > image {
fill: var(--theme-toolbar-checked-color);
}
/* Button states */
.devtools-toolbarbutton[label],
.devtools-toolbarbutton[standalone],
.devtools-button[data-standalone],
.devtools-button:not(:empty) {
background: var(--toolbarbutton-background);
padding: 0 5px;
}
.devtools-toolbarbutton:not([label]):hover,
.devtools-button:empty:not(:disabled):not([aria-expanded="true"]):hover {
background: var(--toolbarbutton-background);
}
.devtools-button:focus {
background-color: var(--theme-toolbar-hover);
}
/* Selectable button which is unchecked. */
.devtools-button:not(:empty):not(:disabled):not(.checked):hover,
.devtools-toolbarbutton[label]:not(:-moz-any([checked=true],[disabled])):hover,
.devtools-button:empty:not(:disabled):-moz-any(:hover:active,.checked),
.devtools-toolbarbutton:not([label]):-moz-any([checked],[open],:hover:active),
.devtools-button[aria-haspopup="menu"][aria-expanded="true"] {
background-color: var(--toolbarbutton-hover-background);
border-color: var(--toolbarbutton-hover-border-color);
}
.devtools-button:not(:empty):not(.checked):not(:disabled):hover:active,
.devtools-toolbarbutton:not(:-moz-any([checked=true],[disabled]))[label]:hover:active {
background-color: var(--theme-selection-background-hover);
}
.devtools-button:not(:empty):not(.checked):not(:disabled):focus,
.devtools-toolbarbutton:not(:-moz-any([checked=true],[disabled]))[label]:focus {
background-color: var(--toolbarbutton-focus-background);
color: var(--toolbarbutton-focus-color);
}
/* Selectable button which is checked. */
.devtools-toolbarbutton:not([disabled])[label][checked=true],
.devtools-toolbarbutton:not([disabled])[label][open],
.devtools-button:not(:empty).checked {
background: var(--toolbarbutton-checked-background);
border-color: var(--toolbarbutton-checked-border-color);
color: var(--toolbarbutton-checked-color);
}
.devtools-toolbarbutton:not([disabled])[label][checked=true]:focus,
.devtools-toolbarbutton:not([disabled])[label][open]:focus,
.devtools-button:not(:empty).checked:focus {
background-color: var(--toolbarbutton-checked-focus-background);
}
/* Icons */
.devtools-button.devtools-clear-icon::before {
background-image: var(--clear-icon-url);
}
.devtools-button.devtools-filter-icon::before {
background-image: var(--filter-image);
}
.devtools-toolbarbutton.devtools-clear-icon {
list-style-image: var(--clear-icon-url);
}
.devtools-option-toolbarbutton {
list-style-image: var(--tool-options-image);
}
.devtools-toolbarbutton-group > .devtools-toolbarbutton:last-child {
margin-inline-end: 0;
}
.devtools-toolbarbutton-group + .devtools-toolbarbutton {
margin-inline-start: 3px;
}
/* Text input */
.devtools-textinput,
.devtools-searchinput,
.devtools-filterinput {
-moz-appearance: none;
margin: 1px 3px;
border: 1px solid;
border-radius: 2px;
padding: 4px 6px;
border-color: var(--theme-splitter-color);
font: message-box;
}
:root[platform="mac"] .devtools-textinput,
:root[platform="mac"] .devtools-searchinput,
:root[platform="mac"] .devtools-filterinput {
border-radius: 20px;
}
.devtools-searchinput,
.devtools-filterinput {
padding: 0;
padding-inline-start: 22px;
padding-inline-end: 4px;
background-position: 8px center;
background-size: 11px 11px;
background-repeat: no-repeat;
font-size: inherit;
}
/*
* @TODO : has-clear-btn class was added for bug 1296187 and we should remove it
* once we have a standardized search and filter input across the toolboxes.
*/
.has-clear-btn > .devtools-searchinput,
.has-clear-btn > .devtools-filterinput {
padding-inline-end: 23px;
}
.devtools-searchinput {
background-image: var(--magnifying-glass-image);
}
.devtools-filterinput {
background-image: url(chrome://devtools/skin/images/filter.svg#filterinput);
}
.devtools-searchinput:-moz-locale-dir(rtl),
.devtools-searchinput:dir(rtl),
.devtools-filterinput:-moz-locale-dir(rtl),
.devtools-filterinput:dir(rtl) {
background-position: calc(100% - 8px) center;
}
/* This is needed to remove the default search icon on windows. See bug 1400615. */
.devtools-filterinput > .textbox-input-box > .textbox-search-sign {
display: none;
}
.devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-icon,
.devtools-filterinput > .textbox-input-box > .textbox-search-icons > .textbox-search-icon {
visibility: hidden;
}
.devtools-searchinput .textbox-input::placeholder,
.devtools-filterinput .textbox-input::placeholder {
font-style: normal;
}
.devtools-plaininput {
border-color: transparent;
background-color: transparent;
}
.theme-dark .devtools-plaininput {
color: var(--theme-highlight-gray);
}
/* Searchbox is a div container element for a search input element */
.devtools-searchbox {
display: inline-flex;
flex: 1;
height: 23px;
position: relative;
padding: 0 3px;
}
/* The spacing is accomplished with a padding on the searchbox */
.devtools-searchbox > .devtools-textinput,
.devtools-searchbox > .devtools-searchinput,
.devtools-searchbox > .devtools-filterinput {
margin-left: 0;
margin-right: 0;
width: 100%;
}
.devtools-textinput:focus,
.devtools-searchinput:focus,
.devtools-filterinput:focus {
border-color: var(--theme-focus-border-color-textbox);
box-shadow: var(--theme-focus-box-shadow-textbox);
transition: all 0.2s ease-in-out;
outline: none;
}
.devtools-searchbox .devtools-autocomplete-popup {
position: absolute;
left: 0;
top: 100%;
width: 100%;
line-height: initial !important;
/* See bug - 1414609. z-index is greater than 1000 so that searchbox's z-index
is more than z-index of requests-list-headers-wrapper in netmonitor */
z-index: 1001;
}
/* MDN link within the Searchbox */
.devtools-searchbox .learn-more-link:before {
height: 20px;
}
.devtools-searchbox .learn-more-link {
background: transparent !important;
cursor: pointer;
display: none;
}
.devtools-searchbox:hover .learn-more-link {
display: block;
}
/* Don't add 'double spacing' for inputs that are at beginning / end
of a toolbar (since the toolbar has it's own spacing). */
.devtools-toolbar > .devtools-textinput:first-child,
.devtools-toolbar > .devtools-searchinput:first-child,
.devtools-toolbar > .devtools-filterinput:first-child {
margin-inline-start: 0;
}
.devtools-toolbar > .devtools-textinput:last-child,
.devtools-toolbar > .devtools-searchinput:last-child,
.devtools-toolbar > .devtools-filterinput:last-child {
margin-inline-end: 0;
}
.devtools-toolbar > .devtools-searchbox:first-child {
padding-inline-start: 0;
}
.devtools-toolbar > .devtools-searchbox:last-child {
padding-inline-end: 0;
}
.devtools-rule-searchbox {
-moz-box-flex: 1;
width: 100%;
}
.devtools-filterinput:-moz-any([filled],.filled) {
background-color: var(--searchbox-background-color);
border-color: var(--searchbox-border-color);
}
.devtools-style-searchbox-no-match {
background-color: var(--searcbox-no-match-background-color) !important;
border-color: var(--searcbox-no-match-border-color) !important;
}
.devtools-searchinput-clear {
position: absolute;
top: 3.5px;
inset-inline-end: 7px;
padding: 0;
border: 0;
width: 16px;
height: 16px;
background-position: 0 0;
background-repeat: no-repeat;
background-color: transparent;
}
.devtools-searchinput-clear:dir(rtl) {
right: unset;
left: 7px;
}
.theme-dark .devtools-searchinput-clear {
background-image: url("chrome://devtools/skin/images/search-clear-dark.svg");
}
.theme-light .devtools-searchinput-clear {
background-image: url("chrome://devtools/skin/images/search-clear-light.svg");
}
.devtools-style-searchbox-no-match + .devtools-searchinput-clear {
background-image: url("chrome://devtools/skin/images/search-clear-failed.svg") !important;
}
.devtools-searchinput-clear:hover {
background-position: -16px 0;
}
.theme-dark .devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear,
.theme-dark .devtools-filterinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear {
list-style-image: url("chrome://devtools/skin/images/search-clear-dark.svg");
-moz-image-region: rect(0, 16px, 16px, 0);
}
.theme-light .devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear,
.theme-light .devtools-filterinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear {
list-style-image: url("chrome://devtools/skin/images/search-clear-light.svg");
-moz-image-region: rect(0, 16px, 16px, 0);
}
.devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear,
.devtools-filterinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear {
margin-bottom: 0;
}
.devtools-searchinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear:hover,
.devtools-filterinput > .textbox-input-box > .textbox-search-icons > .textbox-search-clear:hover {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
/* Twisty and checkbox controls */
.theme-twisty, .theme-checkbox {
width: 14px;
height: 14px;
background-repeat: no-repeat;
background-image: url("chrome://devtools/skin/images/controls.png");
background-size: 56px 28px;
}
.theme-twisty {
cursor: pointer;
background-position: 0 -14px;
}
.theme-selected ~ .theme-twisty,
.theme-dark .theme-twisty {
background-position: -28px -14px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty[open], .theme-twisty.open {
background-position: -14px -14px;
}
.theme-selected ~ .theme-twisty[open],
.theme-dark .theme-twisty[open], .theme-dark .theme-twisty.open {
background-position: -42px -14px;
}
.theme-twisty[invisible] {
visibility: hidden;
}
/* Mirror the twisty for rtl direction */
.theme-twisty:dir(rtl),
.theme-twisty:-moz-locale-dir(rtl) {
transform: scaleX(-1);
}
.theme-checkbox {
display: inline-block;
border: 0;
padding: 0;
outline: none;
background-position: 0 0;
}
.theme-dark .theme-checkbox {
background-position: -28px 0;
}
.theme-checkbox[checked] {
background-position: -14px 0;
}
.theme-dark .theme-checkbox[checked] {
background-position: -42px 0;
}
@media (min-resolution: 1.1dppx) {
.theme-twisty, .theme-checkbox {
background-image: url("chrome://devtools/skin/images/controls@2x.png");
}
}
/* Throbbers */
.devtools-throbber::before {
content: "";
display: inline-block;
vertical-align: bottom;
margin-inline-end: 0.5em;
width: 1em;
height: 1em;
border: 2px solid currentColor;
border-right-color: transparent;
border-radius: 50%;
animation: 1.1s linear throbber-spin infinite;
}
@keyframes throbber-spin {
from {
transform: none;
}
to {
transform: rotate(360deg);
}
}
/* Common tabs styles */
.all-tabs-menu {
position: absolute;
top: 0;
inset-inline-end: 0;
width: 15px;
height: 100%;
padding: 0;
border: none;
border-inline-start: 1px solid var(--theme-splitter-color);
background: var(--theme-tab-toolbar-background);
background-image: url("chrome://devtools/skin/images/dropmarker.svg");
background-repeat: no-repeat;
background-position: center;
-moz-context-properties: fill;
fill: var(--theme-toolbar-photon-icon-color);
}
.all-tabs-menu:hover {
background-color: var(--theme-toolbar-hover);
}
.all-tabs-menu:hover:active {
background-color: var(--theme-toolbar-hover-active);
}
.devtools-tab-line {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
background: transparent;
transition: transform 250ms var(--animation-curve), opacity 250ms var(--animation-curve);
opacity: 0;
transform: scaleX(0);
}
.devtools-tab:hover .devtools-tab-line,
.tabs-menu-item:hover .devtools-tab-line {
background: var(--tab-line-hover-color);
opacity: 1;
transform: scaleX(1);
}
.devtools-tab.selected .devtools-tab-line,
.tabs-menu-item.is-active .devtools-tab-line {
background: var(--tab-line-selected-color);
opacity: 1;
transform: scaleX(1);
}
@media (prefers-reduced-motion) {
.devtools-tab-line {
transition: none;
}
}
.devtools-tab:not(.selected):focus .devtools-tab-line {
background: var(--tab-line-hover-color);
opacity: 1;
transform: scaleX(1);
}
/* No result message styles */
.devtools-sidepanel-no-result {
font-style: italic;
padding: 0.5em 21px;
-moz-user-select: none;
font-size: 12px;
}
/* Checkbox Toggle */
.devtools-checkbox-toggle {
--x-pos: .15em;
/* Reset native checkbox styling. */
-moz-appearance: none;
background-color: var(--toggle-track-color);
cursor: pointer;
/* Change font-size to scale. */
font-size: 16px;
width: 2em;
height: 1em;
border-radius: 1em;
/* Animate the thumb position between states of the checkbox. */
transition: background-color .1s ease-out;
}
.devtools-checkbox-toggle:focus {
box-shadow: 0 0 0 1px var(--blue-55);
}
.devtools-checkbox-toggle:checked:focus {
background-color: var(--blue-40);
box-shadow: none;
}
.devtools-checkbox-toggle:checked {
--x-pos: 1.15em;
background-color: var(--blue-55);
}
.devtools-checkbox-toggle::before {
position: relative;
width: calc(1em - .3em);
height: calc(1em - .3em);
transform: translateY(.15em) translateX(var(--x-pos));
border-radius: 100%;
display: block;
content: "";
background-color: var(--toggle-thumb-color);
transition: transform .1s ease-out;
}
.devtools-checkbox-toggle:checked::before {
background-color: white;
}