Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / toolkit / content / xul.css
blobe8635d4525351cedb25bd6af280e10f3839d3b63
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 /**
6 * Rules for everything related to XUL except scrollbars can be found in this
7 * file.
9 * This file should also not contain any app specific styling. Defaults for
10 * widgets of a particular application should be in that application's style
11 * sheet. For example, style definitions for browser can be found in
12 * browser.css.
15 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
16 @namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
18 * {
19 -moz-user-focus: ignore;
20 display: flex;
21 box-sizing: border-box;
24 /* hide the content and destroy the frame */
25 [hidden="true"] {
26 display: none;
29 /* hide the content, but don't destroy the frames */
30 [collapsed="true"] {
31 visibility: collapse;
34 /* TODO: investigate unifying these two root selectors
35 * https://bugzilla.mozilla.org/show_bug.cgi?id=1592344
37 *|*:root {
38 --animation-easing-function: cubic-bezier(.07, .95, 0, 1);
39 flex: 1;
40 -moz-box-collapse: legacy;
43 :root {
44 text-rendering: optimizeLegibility;
45 -moz-control-character-visibility: visible;
46 width: 100%;
47 height: 100%;
48 user-select: none;
51 :root:-moz-locale-dir(rtl) {
52 direction: rtl;
55 /* XUL doesn't show outlines by default */
56 :focus-visible {
57 outline: initial;
61 * Native anonymous popups and tooltips in html are document-level, which means
62 * that they don't inherit from the root, so this is needed.
64 popupgroup:-moz-native-anonymous:-moz-locale-dir(rtl),
65 tooltip:-moz-native-anonymous:-moz-locale-dir(rtl) {
66 direction: rtl;
69 /* ::::::::::
70 :: Rules for 'hiding' portions of the chrome for special
71 :: kinds of windows (not JUST browser windows) with toolbars
72 ::::: */
74 *|*:root[chromehidden~="menubar"] .chromeclass-menubar,
75 *|*:root[chromehidden~="directories"] .chromeclass-directories,
76 *|*:root[chromehidden~="status"] .chromeclass-status,
77 *|*:root[chromehidden~="extrachrome"] .chromeclass-extrachrome,
78 *|*:root[chromehidden~="location"] .chromeclass-location,
79 *|*:root[chromehidden~="location"][chromehidden~="toolbar"] .chromeclass-toolbar,
80 *|*:root[chromehidden~="toolbar"] .chromeclass-toolbar-additional {
81 display: none;
84 /* ::::::::::
85 :: Rules for forcing direction for entry and display of URIs
86 :: or URI elements
87 ::::: */
89 .uri-element {
90 direction: ltr !important;
93 /****** elements that have no visual representation ******/
95 script, data, commandset, command,
96 broadcasterset, broadcaster, observes,
97 keyset, key, toolbarpalette, template,
98 treeitem, treeseparator, treerow, treecell {
99 display: none;
102 /********** focus rules **********/
104 button,
105 checkbox,
106 menulist,
107 radiogroup,
108 richlistbox,
109 tree,
110 browser,
111 editor,
112 iframe,
113 label:is(.text-link, [onclick]),
114 tab[selected="true"]:not([ignorefocus="true"]) {
115 -moz-user-focus: normal;
118 /* Avoid losing focus on tabs by keeping them focusable, since some browser
119 * tests rely on this.
121 * TODO(emilio): Remove this and fix the tests / front-end code:
122 * * browser/base/content/test/general/browser_tabfocus.js
124 tab:focus {
125 -moz-user-focus: normal;
128 /******** window & page ******/
130 window {
131 overflow: clip;
132 flex-direction: column;
135 /******** box *******/
137 vbox {
138 flex-direction: column;
141 /********** label **********/
143 label {
144 display: inline-block;
147 description {
148 display: flow-root;
151 label html|span.accesskey {
152 text-decoration: underline;
153 text-decoration-skip-ink: none;
156 description:where([value]) {
157 /* Preserves legacy behavior, maybe could be removed */
158 display: flex;
161 label:where([value]) {
162 /* Preserves legacy behavior, maybe could be removed */
163 display: inline-flex;
166 :is(label, description)[value] {
167 white-space: nowrap;
170 :is(label, description)[value]::before {
171 /* This displays the value attribute, along with the underlined
172 * accesskey if needed */
173 content: -moz-label-content;
174 display: block;
177 label[value=""]::before {
178 content: "\200b" !important; /* zwsp */
181 :is(label, description)[value][crop] {
182 min-width: 0;
185 :is(label, description)[value][crop]::before {
186 min-width: 0;
187 max-width: 100%;
188 /* This implements crop=end */
189 overflow: hidden;
190 text-overflow: ellipsis;
193 /* Invert the direction to clip at the start rather than end */
194 :is(label, description)[value][crop="start"]::before {
195 direction: rtl;
196 /* Mark text as ltr to preserve punctuation/numeric order */
197 content: "\200e" -moz-label-content;
200 :is(label, description)[value][crop="start"]:-moz-locale-dir(rtl)::before {
201 direction: ltr;
202 /* Mark text as rtl to preserve punctuation/numeric order */
203 content: "\200f" -moz-label-content;
206 .checkbox-label-box,
207 .radio-label-box {
208 min-width: 0;
211 /********** toolbarbutton **********/
213 toolbarbutton {
214 align-items: center;
215 justify-content: center;
218 toolbarbutton.tabbable {
219 -moz-user-focus: normal !important;
222 toolbarbutton[crop] {
223 min-width: 0;
226 .toolbarbutton-text {
227 display: block;
228 text-align: center;
231 toolbar[mode="icons"] .toolbarbutton-text,
232 toolbar[mode="text"] .toolbarbutton-icon,
233 html|label.toolbarbutton-badge:empty {
234 display: none;
237 .toolbarbutton-icon,
238 .toolbarbutton-text,
239 .toolbarbutton-badge-stack,
240 .toolbarbutton-menu-dropmarker,
241 .treecol-text,
242 .treecol-sortdirection,
243 .menubar-left,
244 .menubar-text,
245 .menu-text,
246 .menu-iconic-text,
247 .menu-iconic-highlightable-text,
248 .menu-iconic-left,
249 .menu-right,
250 .menu-accel-container,
251 .button-box {
252 /* Preserves legacy behavior */
253 pointer-events: none;
256 /********** button **********/
258 button {
259 -moz-default-appearance: button;
260 appearance: auto;
263 dropmarker {
264 -moz-default-appearance: -moz-menulist-arrow-button;
265 appearance: auto;
268 /******** browser, editor, iframe ********/
270 browser,
271 editor,
272 iframe {
273 display: inline;
276 /* Allow the browser to shrink below its intrinsic size, to match legacy
277 * behavior */
278 browser {
279 align-self: stretch;
280 justify-self: stretch;
281 min-height: 0;
282 min-width: 0;
283 contain: size;
286 /*********** popup notification ************/
287 popupnotification {
288 flex-direction: column;
291 .popup-notification-menubutton:not([label]) {
292 display: none;
295 /********** radio **********/
297 radiogroup {
298 flex-direction: column;
301 /******** groupbox *********/
303 groupbox {
304 flex-direction: column;
307 /******** draggable elements *********/
309 toolbar:not([nowindowdrag="true"], [customizing="true"]) {
310 -moz-window-dragging: drag;
313 /* The list below is non-comprehensive and will probably need some tweaking. */
314 toolbaritem,
315 toolbarbutton,
316 toolbarseparator,
317 button,
318 search-textbox,
319 html|input,
320 tab,
321 radio,
322 splitter,
323 menu,
324 menulist {
325 -moz-window-dragging: no-drag;
328 titlebar {
329 pointer-events: auto !important;
332 /******* toolbar *******/
334 toolbox {
335 flex-direction: column;
338 @media (-moz-platform: macos) {
339 toolbar[type="menubar"] {
340 min-height: 0 !important;
341 border: 0 !important;
345 toolbarspring {
346 flex: 1000 1000;
349 /********* menu ***********/
351 menubar > menu:empty {
352 visibility: collapse;
355 .menu-text {
356 flex: 1;
359 /********* menupopup, panel, & tooltip ***********/
361 menupopup,
362 panel {
363 flex-direction: column;
366 menupopup,
367 panel,
368 tooltip {
369 position: fixed;
370 -moz-top-layer: top;
371 width: fit-content;
372 height: fit-content;
373 /* Popups can't have overflow */
374 contain: paint;
375 z-index: 2147483647;
376 text-shadow: none;
379 tooltip {
380 appearance: auto;
381 -moz-default-appearance: tooltip;
383 white-space: pre-wrap;
385 background-color: InfoBackground;
386 color: InfoText;
387 font: message-box;
388 padding: 2px 3px;
389 max-width: 40em;
390 overflow: clip;
391 pointer-events: none;
394 tooltip:not([position]) {
395 margin-top: 21px;
399 * It's important that these styles are in a UA sheet, because the default
400 * tooltip is native anonymous content
402 @media (-moz-platform: linux) {
403 tooltip {
404 padding: 6px 10px; /* Matches Adwaita. */
405 line-height: 1.4; /* For Noto Sans; note that 1.2 may clip descenders. */
409 @media (-moz-platform: macos) {
410 tooltip {
411 padding: 2px 6px; /* Matches native metrics. */
415 @media (-moz-platform: windows) {
416 tooltip {
417 appearance: none;
418 border: 1px solid;
421 /* TODO(emilio): Probably make InfoText/InfoBackground do the right thing and
422 * remove this? */
423 @media not (prefers-contrast) {
424 tooltip {
425 background-color: #f9f9fb;
426 color: black;
427 border-color: #67676c;
428 border-radius: 4px;
431 @media (prefers-color-scheme: dark) {
432 tooltip {
433 background-color: #2b2a33;
434 color: white;
435 border-color: #f9f9fb;
441 @media (-moz-panel-animations) and (prefers-reduced-motion: no-preference) {
442 @media (-moz-platform: macos) {
443 /* On Mac, use the properties "-moz-window-transform" and "-moz-window-opacity"
444 instead of "transform" and "opacity" for these animations.
445 The -moz-window* properties apply to the whole window including the window's
446 shadow, and they don't affect the window's "shape", so the system doesn't
447 have to recompute the shadow shape during the animation. This makes them a
448 lot faster. In fact, Gecko no longer triggers shadow shape recomputations
449 for repaints.
450 These properties are not implemented on other platforms. */
451 panel[type="arrow"]:not([animate="false"]) {
452 transition-property: -moz-window-transform, -moz-window-opacity;
453 transition-duration: 0.18s, 0.18s;
454 transition-timing-function:
455 var(--animation-easing-function), ease-out;
458 /* Only do the fade-in animation on pre-Big Sur to avoid missing shadows on
459 * Big Sur, see bug 1672091. */
460 @media (-moz-mac-big-sur-theme: 0) {
461 panel[type="arrow"]:not([animate="false"]) {
462 -moz-window-opacity: 0;
463 -moz-window-transform: translateY(-70px);
466 panel[type="arrow"][side="bottom"]:not([animate="false"]) {
467 -moz-window-transform: translateY(70px);
471 /* [animate] is here only so that this rule has greater specificity than the
472 * rule right above */
473 panel[type="arrow"][animate][animate="open"] {
474 -moz-window-opacity: 1.0;
475 transition-duration: 0.18s, 0.18s;
476 -moz-window-transform: none;
477 transition-timing-function:
478 var(--animation-easing-function), ease-in-out;
481 panel[type="arrow"][animate][animate="cancel"] {
482 -moz-window-opacity: 0;
483 -moz-window-transform: none;
485 } /* end of macOS rules */
487 @media not (-moz-platform: macos) {
488 panel[type="arrow"]:not([animate="false"]) {
489 opacity: 0;
490 transform: translateY(-70px);
491 transition-property: transform, opacity;
492 transition-duration: 0.18s, 0.18s;
493 transition-timing-function:
494 var(--animation-easing-function), ease-out;
495 will-change: transform, opacity;
498 panel[type="arrow"][side="bottom"]:not([animate="false"]) {
499 transform: translateY(70px);
502 /* [animate] is here only so that this rule has greater specificity than the
503 * rule right above */
504 panel[type="arrow"][animate][animate="open"] {
505 opacity: 1.0;
506 transition-duration: 0.18s, 0.18s;
507 transform: none;
508 transition-timing-function:
509 var(--animation-easing-function), ease-in-out;
512 panel[type="arrow"][animate][animate="cancel"] {
513 transform: none;
515 } /* end of non-macOS rules */
518 panel[type="arrow"][animating] {
519 pointer-events: none;
522 /******** tree ******/
524 treecolpicker {
525 order: 2147483646;
528 treechildren {
529 display: flex;
530 flex: 1;
533 tree {
534 flex-direction: column;
537 tree[hidecolumnpicker="true"] treecolpicker {
538 display: none;
541 treecol {
542 min-width: 16px;
543 /* This preserves the behavior of -moz-box-ordinal-group. To change this we'd
544 * need to migrate the persisted ordinal values etc. */
545 order: 1;
548 treecol[hidden="true"] {
549 visibility: collapse;
550 display: flex;
553 /* ::::: lines connecting cells ::::: */
554 tree:not([treelines="true"]) treechildren::-moz-tree-line {
555 visibility: hidden;
558 treechildren::-moz-tree-cell(ltr) {
559 direction: ltr !important;
562 /********** deck, tabpanels & stack *********/
564 tabpanels > *|*:not(:-moz-native-anonymous) {
565 /* tabpanels is special: we want to avoid displaying them, but we still want
566 * the hidden children to be accessible */
567 -moz-subtree-hidden-only-visually: 1;
570 deck > *|*:not(:-moz-native-anonymous) {
571 visibility: hidden;
574 tabpanels > .deck-selected,
575 deck > .deck-selected {
576 -moz-subtree-hidden-only-visually: 0;
577 visibility: inherit;
580 tabpanels,
581 deck,
582 stack {
583 display: grid;
584 position: relative;
587 /* We shouldn't style native anonymous children like scrollbars or what not. */
588 tabpanels > *|*:not(:-moz-native-anonymous),
589 deck > *|*:not(:-moz-native-anonymous),
590 stack > *|*:not(:-moz-native-anonymous) {
591 grid-area: 1 / 1;
592 z-index: 0;
595 The default `min-height: auto` value makes grid items refuse to be smaller
596 than their content. This doesn't match the traditional behavior of XUL stack,
597 which often shoehorns tall content into a smaller stack and allows the content
598 to decide how to handle overflow (e.g. by scaling down if it's an image, or
599 by adding scrollbars if it's scrollable).
601 min-height: 0;
604 /********** tabbox *********/
606 tabbox {
607 flex-direction: column;
608 min-height: 0;
611 tabpanels {
612 min-height: 0;
615 tabs {
616 flex-direction: row;
619 tab {
620 align-items: center;
621 justify-content: center;
624 /********** tooltip *********/
626 tooltip[titletip="true"] {
627 /* The width of the tooltip isn't limited on cropped <tree> cells. */
628 max-width: none;
631 /********** basic rule for anonymous content that needs to pass box properties through
632 ********** to an insertion point parent that holds the real kids **************/
634 .box-inherit {
635 align-items: inherit;
636 justify-content: inherit;
637 flex-grow: inherit;
638 flex-shrink: inherit;
639 flex-direction: inherit;
642 /********** textbox **********/
644 search-textbox {
645 text-shadow: none;
648 /* Prefix with (xul|*):root to workaround HTML tests loading xul.css */
649 :root html|textarea:not([resizable="true"]) {
650 resize: none;
653 /********** autocomplete textbox **********/
655 .autocomplete-richlistbox {
656 -moz-user-focus: ignore;
657 overflow-x: hidden !important;
658 flex: 1;
661 .autocomplete-richlistitem {
662 flex-direction: column;
663 align-items: center;
664 overflow: clip;
667 /* The following rule is here to fix bug 96899 (and now 117952).
668 Somehow trees create a situation
669 in which a popupset flows itself as if its popup child is directly within it
670 instead of the placeholder child that should actually be inside the popupset.
671 This is a stopgap measure, and it does not address the real bug. */
672 .autocomplete-result-popupset {
673 max-width: 0px;
674 width: 0 !important;
675 min-width: 0%;
676 min-height: 0%;
679 /********** menulist **********/
681 menulist[popuponly] {
682 appearance: none !important;
683 margin: 0 !important;
684 height: 0 !important;
685 min-height: 0 !important;
686 border: 0 !important;
687 padding: 0 !important;
690 /********** splitter **********/
692 .tree-splitter {
693 margin-inline: -4px;
694 width: 8px;
695 max-width: 8px;
696 min-width: 8px;
697 appearance: none !important;
698 border: none !important;
699 background: none !important;
700 order: 2147483646;
701 z-index: 2147483646;
704 /******** scrollbar ********/
706 slider {
707 /* This is a hint to layerization that the scrollbar thumb can never leave
708 the scrollbar track. */
709 overflow: hidden;
712 /******** scrollbox ********/
714 scrollbox {
715 /* This makes it scrollable! */
716 overflow: hidden;
719 @media (prefers-reduced-motion: no-preference) {
720 scrollbox[smoothscroll=true] {
721 scroll-behavior: smooth;
725 /********** stringbundle **********/
727 stringbundle,
728 stringbundleset {
729 display: none;
732 /********** dialog **********/
734 dialog {
735 flex: 1;
736 flex-direction: column;
739 /********** wizard **********/
741 wizard {
742 flex: 1;
743 flex-direction: column;
744 contain: inline-size;
745 min-width: 40em;
746 min-height: 30em;
749 wizard > wizardpage {
750 grid-area: 1 / 1;
751 min-height: 0;
754 wizard > wizardpage:not(.selected) {
755 visibility: hidden;
758 wizardpage {
759 flex-direction: column;
760 overflow: auto;
763 /********** Rich Listbox ********/
765 richlistbox {
766 flex-direction: column;
767 overflow: auto;
768 min-width: 0;
769 min-height: 0;
772 richlistitem {
773 flex-shrink: 0;
776 /*********** findbar ************/
777 findbar {
778 overflow-x: hidden;
779 contain: inline-size;
782 /* Some elements that in HTML blocks should be inline-level by default */
783 button, image {
784 display: inline-flex;
787 .menu-iconic-highlightable-text:not([highlightable="true"]),
788 .menu-iconic-text[highlightable="true"] {
789 display: none;
792 [orient="vertical"] { flex-direction: column !important; }
793 [orient="horizontal"] { flex-direction: row !important; }
795 [align="start"] { align-items: flex-start !important; }
796 [align="center"] { align-items: center !important; }
797 [align="end"] { align-items: flex-end !important; }
798 [align="baseline"] { align-items: baseline !important; }
799 [align="stretch"] { align-items: stretch !important; }
801 [pack="start"] { justify-content: start !important; }
802 [pack="center"] { justify-content: center !important; }
803 [pack="end"] { justify-content: flex-end !important; }
805 [flex="0"] { flex: none !important; }
806 [flex="1"] { flex: 1 !important; }