summaryrefslogtreecommitdiffstats
path: root/toolkit/themes/shared/menu-scrolling.css
blob: d0a62d130ddf4d2f029f95bc3fe78df958626818 (plain)
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
/* 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/. */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* Scroll buttons */

/* Hide arrow buttons when there's nothing to scroll in that direction */
.menupopup-arrowscrollbox[scrolledtostart="true"]::part(scrollbutton-up),
.menupopup-arrowscrollbox[scrolledtoend="true"]::part(scrollbutton-down) {
  display: none;
}

/* Prevent the scrolled contents of the menupopup from jumping vertically when
 * the arrow buttons appear / disappear, by positioning ::part(scrollbox) in
 * such a way that its edges are at the same position as the edges of
 * arrowscrollbox regardless of scroll button visibility.
 */
.menupopup-arrowscrollbox:not([scrolledtostart="true"])::part(scrollbox) {
  /* scrollbutton-up is visible; shift our top edge up by its height. */
  margin-top: -16px;
}

.menupopup-arrowscrollbox:not([scrolledtoend="true"])::part(scrollbox) {
  /* scrollbutton-down is visible; shift our bottom edge down by its height. */
  margin-bottom: -16px;
}

.menupopup-arrowscrollbox::part(scrollbox-clip) {
  /* In the space where the arrow buttons overlap the scrollbox, clip away the
   * scrollbox so that nothing is shown behind the arrow button even if the
   * button is transparent.
   */
  overflow: clip;
}