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/. */
5 /* Import stylesheets for specific tooltip widgets */
6 @import url
(chrome://devtools
/skin
/accessibility-color-contrast
.css
);
7 @import url
(chrome://devtools
/skin
/badge
.css
);
8 @import url
(chrome://devtools
/content
/shared
/widgets
/cubic-bezier
.css
);
9 @import url
(chrome://devtools
/content
/shared
/widgets
/filter-widget
.css
);
10 @import url
(chrome://devtools
/content
/shared
/widgets
/linear-widget
.css
);
11 @import url
(chrome://devtools
/content
/shared
/widgets
/spectrum
.css
);
12 @import url
(chrome://devtools
/skin
/variables
.css
);
14 * compatibility.css is primarily used by the Compatibility panel, so import it in a layer
15 * to give it a lower importance than the rule here and mitigate styling mismatch.
17 @import url
(chrome://devtools
/skin
/compatibility
.css
) layer
(shared
);
19 /* Tooltip specific theme variables */
21 --bezier-diagonal-color: #eee;
22 --bezier-grid-color: rgba
(255, 255, 255, 0.1);
25 --theme-tooltip-color: var
(--theme-text-color-strong
);
26 --theme-tooltip-background: var
(--theme-popup-background
);
27 --theme-tooltip-shadow-color: rgba
(25, 25, 25, 0.76);
30 /* These colors are based on the colors used for doorhangers elsewhere in
32 --theme-arrowpanel-background: var
(--theme-popup-background
);
33 --theme-arrowpanel-color: var
(--theme-popup-color
);
34 --theme-arrowpanel-border-color: var
(--theme-popup-border-color
);
35 --theme-arrowpanel-separator: rgba
(249,249,250,.1);
36 --theme-arrowpanel-dimmed: var
(--theme-popup-dimmed
);
37 --theme-arrowpanel-dimmed-further: rgba
(249,249,250,.15);
38 --theme-arrowpanel-disabled-color: rgba
(249,249,250,.5);
42 --bezier-diagonal-color: rgba
(0, 0, 0, 0.2);
43 --bezier-grid-color: rgba
(0, 0, 0, 0.05);
46 --theme-tooltip-color: var
(--theme-body-color
);
47 --theme-tooltip-background: rgb
(255, 255, 255);
48 --theme-tooltip-shadow-color: var
(--grey-90-a10
);
51 /* These colors are based on the colors used for doorhangers elsewhere in
53 --theme-arrowpanel-background: var
(--theme-popup-background
);
54 --theme-arrowpanel-color: var
(--theme-popup-color
);
55 --theme-arrowpanel-border-color: var
(--theme-popup-border-color
);
56 --theme-arrowpanel-separator: ThreeDShadow
;
57 --theme-arrowpanel-dimmed: var
(--theme-popup-dimmed
);
58 --theme-arrowpanel-dimmed-further: hsla
(0,0%,80%,.45);
59 --theme-arrowpanel-disabled-color: GrayText
;
63 --theme-arrowpanel-border-radius: 3.5px;
66 :root
[platform
="mac"].theme-light
{
67 --theme-arrowpanel-separator: hsla
(210,4%,10%,.14);
71 There's a specific color-scheme defined for panels in https://searchfox.org/mozilla-central/rev/02841791400cf7cf5760c0cfaf31f5d772624253/toolkit/themes/shared/popup.css#9-13
72 This could create issues when the Firefox theme is at odd with the DevTools one (e.g.
73 if Firefox uses a dark theme but the user has a DevTools light theme.
74 Unset the color-scheme on those element so it uses the one we set on :root in common.css,
75 which matches our light/dark theme.
85 /* Tooltip: CSS variables tooltip */
87 .devtools-tooltip-css-variable {
88 color: var
(--theme-body-color
);
91 /* Try to show the content of the tooltip on a single line */
92 inline-size: max-content
;
93 word-break: break-word
;
94 max-inline-size: 100vw;
98 /* Tooltip: Compatibility tooltip */
100 .devtools-tooltip-css-compatibility {
101 color: var
(--theme-body-color
);
106 /* Tooltip: JS Evaluation Context */
108 #webconsole-input-evaluationsButton > .tooltip-panel
{
109 /* helps the JS Context selector to have scrollbars when content exceed the vertical size of the popup */
114 /* Tooltip: Inactive CSS tooltip */
116 .devtools-tooltip-inactive-css
,
117 .devtools-tooltip-css-compatibility {
118 color: var
(--theme-arrowpanel-color
);
120 padding: 10px 14px 12px 14px;
124 .devtools-tooltip-inactive-css
,
125 .devtools-tooltip-css-compatibility
,
126 .devtools-tooltip-inactive-css strong
,
127 .devtools-tooltip-css-compatibility strong {
129 -moz-user-focus: normal
;
132 .devtools-tooltip-inactive-css p
,
133 .devtools-tooltip-css-compatibility p {
134 margin-block-start: 0;
135 margin-block-end: calc
(1em - 4px);
138 .devtools-tooltip-inactive-css
p:last-child
,
139 .devtools-tooltip-css-compatibility p:last-child {
143 .devtools-tooltip-inactive-css
.link
,
144 .devtools-tooltip-css-compatibility .link {
145 color: var
(--theme-link-color
);
149 /* Tooltip: Compatibility tooltip */
151 .tooltip-container[type="doorhanger"] .tooltip-panel ul.compatibility-unsupported-browser-list {
155 justify-content: start
;
158 /* Tooltip: query container info */
159 .devtools-tooltip-query-container {
160 color: var
(--theme-arrowpanel-color
);
162 padding: 10px 14px 12px;
165 -moz-user-focus: normal
;
168 .devtools-tooltip-query-container header {
169 --block-end-space: 5px;
170 border-block-end: 1px solid var
(--theme-arrowpanel-dimmed
);
171 padding-block-end: var
(--block-end-space
);
172 margin-block-end: var
(--block-end-space
);
174 text-overflow: ellipsis
;
176 color: var
(--theme-body-color
);
179 .devtools-tooltip-query-container ul {
185 .devtools-tooltip-query-container .objectBox-node .tag-name {
186 color: var
(--theme-highlight-blue
);
189 .devtools-tooltip-query-container .objectBox-node .attribute-name {
190 color: var
(--theme-highlight-red
);
193 .devtools-tooltip-query-container .property-name {
194 color: var
(--theme-highlight-blue
);
197 .devtools-tooltip-query-container .property-value {
198 color: var
(--theme-highlight-red
);
204 .devtools-tooltip-tiles {
205 background-color: #eee;
206 background-image: linear-gradient
(45deg, #ccc 25%, transparent
25%, transparent
75%, #ccc 75%, #ccc),
207 linear-gradient
(45deg, #ccc 25%, transparent
25%, transparent
75%, #ccc 75%, #ccc);
208 background-size: 20px 20px;
209 background-position: 0 0, 10px 10px;
216 background: transparent
;
217 pointer-events: none
;
219 filter: drop-shadow
(0 2px 8px var
(--theme-tooltip-shadow-color
));
222 .tooltip-xul-wrapper {
223 /* All these are drawn by the tooltip-container, effectively */
225 background: transparent
;
228 -moz-window-shadow: none
;
229 --panel-border-radius: 0px;
230 --panel-padding: 0px;
231 --panel-background: transparent
;
232 --panel-border-color: transparent
;
233 --panel-shadow: none
;
235 /* This is enough room for the shadow of the tooltip-container */
236 --panel-shadow-margin: 10px;
240 /* Avoid clipping the drop-shadow */
244 &.non-interactive-toggle
{
245 /* We need to make toggled-on-hover panels transparent to events, otherwise
246 * hovering over the panel shadow would toggle the panel. */
247 pointer-events: none
;
250 /* The panel is absolutely positioned itself. */
251 > .tooltip-container
{
257 flex-direction: column
;
261 flex-direction: column-reverse
;
265 background-color: var
(--theme-tooltip-background
);
279 /* Tooltip : flexible height styles */
281 .tooltip-flexible-height .tooltip-panel {
282 /* In flexible mode the tooltip panel should only grow according to its content. */
286 .tooltip-flexible-height .tooltip-filler {
287 /* In flexible mode the filler should grow as much as possible. */
291 /* Tooltip : arrow style */
293 .tooltip-container[type="arrow"] > .tooltip-panel {
296 box-sizing: border-box
;
298 border-radius: var
(--theme-arrowpanel-border-radius
);
301 .tooltip-top[type="arrow"] .tooltip-panel {
305 .tooltip-bottom[type="arrow"] .tooltip-panel {
311 box-sizing: border-box
;
318 /* In RTL locales and context, only use RTL on the tooltip content, keep LTR for positioning */
319 .tooltip-container:-moz-locale-dir
(rtl
),
320 .tooltip-container:dir(rtl) {
324 .tooltip-panel:-moz-locale-dir
(rtl
),
325 .tooltip-panel:dir(rtl) {
329 .tooltip-top .tooltip-arrow {
331 * The -1px margin is there to make sure the middle of the arrow overlaps with
332 * the border of the tooltip container.
333 * The -2px is there because the rotated arrow is not visually as tall as its
334 * container. Since the positioning logic relies on measuring the size of the
335 * tooltip, this -2px ensures the measured size matches the visuals (and not
336 * simply the box model).
342 .tooltip-bottom .tooltip-arrow {
343 /* See comment in .tooltip-top .tooltip-arrow (inverted here) */
348 .tooltip-arrow::before {
354 background: linear-gradient
(-45deg,
355 var
(--theme-tooltip-background
) 50%, transparent
50%);
358 box-sizing: border-box
;
361 .tooltip-bottom .tooltip-arrow::before {
363 transform: rotate
(225deg);
366 .tooltip-top .tooltip-arrow::before {
368 transform: rotate
(45deg);
371 /* XUL panels have a default border, but pure HTML tooltips don't have one. */
372 .tooltip-container
[type
="arrow"] > .tooltip-panel
,
373 .tooltip-container[type="arrow"] > .tooltip-arrow::before {
374 border: 1px solid var
(--theme-arrowpanel-border-color
);
377 /* Tooltip : doorhanger style */
379 .tooltip-container[type="doorhanger"] {
381 color: var
(--theme-arrowpanel-color
);
388 > .tooltip-arrow::before
{
389 background: var
(--theme-arrowpanel-background
);
390 border: 1px solid var
(--theme-arrowpanel-border-color
);
391 border-radius: var
(--theme-arrowpanel-border-radius
);
392 box-shadow: 0 0 4px hsla
(210,4%,10%,.2);
396 /* Desired width of the arrow */
399 /* Amount of room to allow for the shadow. Should be about half the radius. */
400 --shadow-radius: 4px;
401 --shadow-margin: calc
(var
(--shadow-radius
) / 2);
404 * Crop the arrow region to show half the arrow plus allow room for margins.
406 * The ARROW_WIDTH in HTMLTooltip.js needs to match the following value.
408 width: calc
(var
(--arrow-width
) + 2 * var
(--shadow-margin
));
409 height: calc
(var
(--arrow-width
) / 2 + var
(--shadow-margin
));
412 * The rotated box slightly overlaps the left edge of the arrow container.
413 * This means the arrow is not centered in its own box by default.
418 /* Don't inherit any rounded corners. */
422 * When the box is rotated, it should have width <arrow-width>.
423 * That makes the length of one side of the box equal to:
425 * (<arrow-width> / 2) / sin 45
427 --sin-45: 0.707106781;
428 --square-side: calc
(var
(--arrow-width
) / 2 / var
(--sin-45
));
429 width: var
(--square-side
);
430 height: var
(--square-side
);
433 * The rotated square will overshoot the left side
434 * and need to be shifted in by:
436 * (<arrow-width> - square side) / 2
438 * But we also want to shift it in so that the box-shadow
439 * is not clipped when we clip the parent so we add
440 * a suitable margin for that.
442 --overhang: calc
((var
(--arrow-width
) - var
(--square-side
)) / 2);
443 margin-left: calc
(var
(--overhang
) + var
(--shadow-margin
));
447 &.tooltip-top
> .tooltip-arrow
{
448 /* Overlap the arrow with the 1px border of the doorhanger */
452 /* Show only the bottom half of the box */
453 margin-top: calc
(var
(--square-side
) / -2);
457 &.tooltip-bottom
> .tooltip-arrow
{
458 /* Overlap the arrow with the 1px border of the doorhanger */
462 /* Shift the rotated box in so that it is not clipped */
463 margin-top: calc
(var
(--overhang
) + var
(--shadow-margin
));
467 .menu-standard-padding {
473 /* Override the display: flex declaration in xul.css
474 * or else menu items won't stack. */
483 .menuitem > .command {
485 align-items: baseline
;
489 * It doesn't really make sense, since if this is just about making the items
490 * easier to click we should be using min-width instead.
492 margin-inline-end: 15px;
495 --theme-outline-offset: -2px;
498 &:not
([disabled
],[open
],:active
):hover
{
499 background-color: var
(--theme-arrowpanel-dimmed
);
502 &:not
([disabled
]):is
([open
],:hover:active
) {
503 background-color: var
(--theme-arrowpanel-dimmed-further
);
504 box-shadow: 0 1px 0 hsla
(210,4%,10%,.03) inset
;
511 &[aria-checked
="true"] {
512 list-style-image: none
;
513 -moz-context-properties: fill
;
515 background: url
(chrome://devtools
/skin
/images
/check
.svg
) no-repeat transparent
;
516 background-position: 7px center
;
519 &:-moz-locale-dir
(rtl
) {
520 background-position-x: right
7px;
528 text-overflow: ellipsis
;
533 margin-inline-start: 10px;
534 color: var
(--theme-arrowpanel-disabled-color
);
539 .menuitem > button.command:is([role="menuitem"],[role="menuitemcheckbox"],[role="link"]) {
542 color: var
(--theme-arrowpanel-color
);
543 background-color: transparent
;
548 .checkbox-container .menuitem > .command > .label {
549 padding-inline-start: 16px;
555 border-top: 1px solid var
(--theme-arrowpanel-separator
);
560 [role
="menuseparator"] {
562 border-bottom: 1px solid
#cacdd3;
567 pointer-events: none
;
571 .menu-button--iconic::before
,
572 .tooltip-container[type="doorhanger"] .menuitem > .command.iconic > .label::before {
574 display: inline-block
;
575 margin-inline-end: 8px;
578 /* Better optical alignment than with 'vertical-align: middle'.
579 Works well with font sizes between 12px and 16px. */
580 vertical-align: -3px;
581 -moz-context-properties: fill
;
583 background-image: var
(--menuitem-icon-image
);
584 background-size: contain
;
585 background-repeat: no-repeat
;
587 * The icons in the sidebar menu have opacity: 0.8 here, but those in the
588 * hamburger menu don't. For now we match the hamburger menu styling,
589 * especially because the 80% opacity makes the icons look dull in dark mode.
593 /* Tooltip: Events */
595 .devtools-tooltip-events-container {
596 border-radius: var
(--theme-arrowpanel-border-radius
);
603 @media (-moz-overlay-scrollbars
) {
604 .devtools-tooltip-events-container {
605 padding-inline: calc
(env
(scrollbar-inline-size
) / 2);
609 .devtools-tooltip-events-container .event-header {
612 box-sizing: content-box
;
617 color: var
(--theme-tooltip-color
);
618 background-color: var
(--theme-tooltip-background
);
621 .devtools-tooltip-events-container > li + li .event-header {
622 border-top: 1px solid var
(--theme-splitter-color
);
625 .event-header .theme-twisty {
629 margin-inline-end: 4px;
632 background-color: transparent
;
635 .event-header .theme-twisty[aria-expanded="true"] {
639 .event-tooltip-listener-toggle-checkbox {
643 .event-tooltip-debugger-icon {
644 -moz-context-properties: stroke
;
645 stroke: var
(--theme-icon-color
);
646 background-image: url
("chrome://devtools/content/shared/components/reps/images/jump-definition.svg");
647 background-repeat: no-repeat
;
648 background-position: center
;
649 background-color: transparent
;
654 margin-inline-end: 4px;
659 .event-tooltip-debugger-icon:hover {
660 background-color: var
(--toolbarbutton-hover-background
);
663 .event-tooltip-event-type
,
664 .event-tooltip-filename
,
665 .event-tooltip-attributes {
666 margin-inline-start: 0;
671 .event-tooltip-event-type {
677 .event-tooltip-filename {
683 text-overflow: ellipsis
;
684 /* Force ellipsis to be displayed on the left */
688 .event-tooltip-content-box {
692 margin-inline-end: 0;
693 border: 1px solid var
(--theme-splitter-color
);
694 border-width: 1px 0 0 0;
697 .event-toolbox-content-box iframe {
702 .event-tooltip-content-box[open] {
706 .event-tooltip-source-container {
709 margin-inline-start: 5px;
710 margin-inline-end: 0;
713 .event-tooltip-source {
717 .event-tooltip-attributes-container {
721 justify-content: flex-end
;
724 .event-tooltip-attributes-box {
731 margin-inline-start: 4px;
732 background-color: var
(--theme-text-color-alt
);
733 color: var
(--theme-body-background
);
736 .event-tooltip-attributes {
742 .event-tooltip-editor-frame {
748 /* Tooltip: HTML Search */
750 #searchbox-panel-listbox {
756 #searchbox-panel-listbox .autocomplete-item
,
757 #searchbox-panel-listbox .autocomplete-item
[selected
] {
761 /* Tooltip: Image tooltip */
764 * Overview of the Image Tooltip layout.
766 * ┌─────────────────────────────────────────┐
767 * │ .devtools-tooltip-image-container │
768 * │ ┌─────────────────────────────────────┐ │
769 * │ │ .devtools-tooltip-image-wrapper │ │
770 * │ │ ┌─────────────────────────────────┐ │ │
771 * │ │ │ .devtools-tooltip-image │ │ │
772 * │ │ │ (the actual image tag) │ │ │
773 * │ │ └─────────────────────────────────┘ │ │
774 * │ └─────────────────────────────────────┘ │
775 * │ ┌─────────────────────────────────────┐ │
776 * │ │ .devtools-tooltip-image-dimensions │ │
777 * │ └─────────────────────────────────────┘ │
778 * └─────────────────────────────────────────┘
782 .devtools-tooltip-image-container {
783 /* Saved as variables to be synchronized easily with ImageTooltipHelper.js */
784 --image-tooltip-image-padding: 4px;
785 --image-tooltip-label-height: 20px;
788 flex-direction: column
;
794 .devtools-tooltip-image-wrapper {
798 padding: var
(--image-tooltip-image-padding
);
799 justify-content: center
;
803 .devtools-tooltip-image {
807 .devtools-tooltip-image-dimensions {
808 height: var
(--image-tooltip-label-height
);
812 .devtools-tooltip-image-broken {
813 box-sizing: border-box
;
818 /* Tooltip: Invoke getter confirm Tooltip */
821 color: var
(--theme-popup-color
);
822 border: 1px solid rgba
(0,0,0, 0.1);
826 .invoke-confirm .close-confirm-dialog-button::before {
827 background-image: url
("chrome://devtools/skin/images/close.svg");
830 .invoke-confirm .confirm-label {
833 background-color: var
(--theme-toolbar-background-alt
);
838 .invoke-confirm .confirm-label p {
845 .invoke-confirm .emphasized {
846 font-family: var
(--monospace-font-family
);
848 overflow-wrap: break-word
;
851 .invoke-confirm .close-confirm-dialog-button {
857 .invoke-confirm .confirm-button {
858 background-color: var
(--theme-selection-background
);
867 /* The button already has a "selected" style, we can remove the focus rings. */
868 .confirm-button:focus-visible {
872 .invoke-confirm .learn-more-link {
873 color: var
(--theme-link-color
);
874 padding-inline-end: 4px;
877 justify-content: end
;
882 .invoke-confirm .learn-more-link::after {
887 -moz-context-properties: fill
;
888 background-image: url
(chrome://devtools
/skin
/images
/help
.svg
);
889 background-size: contain
;
890 background-repeat: no-repeat
;
891 margin-inline-start: 4px;
894 /* Tooltip: Rule Preview */
896 .rule-preview-tooltip-container {
898 flex-direction: column
;
900 color: var
(--theme-body-color
);
904 .rule-preview-tooltip-message {
905 white-space: pre-wrap
;
908 .rule-preview-tooltip-source-rule-footer {
910 border-top: 1px solid var
(--theme-body-color
);
917 /* Tooltip: Selector warning */
918 .devtools-tooltip-selector-warnings {
927 border-block-start: 1px solid var
(--theme-splitter-color
);