summaryrefslogtreecommitdiffstats
path: root/toolkit/themes/osx/global/popup.css
blob: 7b8440490e5d0e376378a07ff3477e554ed12009 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* 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");
@namespace html url("http://www.w3.org/1999/xhtml");

menupopup,
panel {
  appearance: auto;
  -moz-default-appearance: menupopup;
  /* We set the default background here, rather than on ::part(content),
   * because otherwise it'd interfere with the native look. Non-native-looking
   * popups should get their background via --panel-background */
  background-color: Menu;
  --panel-background: none;
  --panel-color: MenuText;
  --panel-padding: 0;
  --panel-border-color: transparent;
  --panel-border-radius: 0;
  --panel-width: initial;

  /* This var is used on panelUI-shared.css to calculate panel shadow margins,
   * but as shadows on macOS are being taken care of by the OS, there's
   * no need for CSS to do calculations, so just set it to 0px here. */
  --panel-shadow-margin: 0px;
  --panel-shadow: none;
}

menupopup > menu > menupopup {
  margin-top: -4px;
}

menupopup {
  --panel-padding: 4px 0;
}

panel[titlebar] {
  appearance: none; /* to disable rounded corners */
}

:is(panel, menupopup)[type="arrow"] {
  appearance: none;
  background: transparent;
}

:is(panel, menupopup)::part(content) {
  display: -moz-box;
  -moz-box-flex: 1;
  -moz-font-smoothing-background-color: var(--panel-background, -moz-mac-menupopup);
  background: var(--panel-background);
  color: var(--panel-color);
  border-radius: var(--panel-border-radius);
  box-shadow: var(--panel-shadow);
  padding: var(--panel-padding);
  width: var(--panel-width);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--panel-border-color);
}

:is(panel, menupopup)[orient=vertical]::part(content) {
  -moz-box-orient: vertical;
}

:is(panel, menupopup)[type="arrow"]::part(content) {
  margin: 1px;
}

panel[type="arrow"].panel-no-padding::part(content) {
  padding: 0;
  overflow: hidden; /* Don't let panel content overflow the border-radius */
}

/* rules for popups associated with menulists */

menulist > menupopup {
  min-width: 0;
  --panel-padding: 4px 0;
}

menulist > menupopup:not([position]) {
  margin-inline-start: -13px;
  margin-top: -2px;
}

menupopup[customoptionstyling="true"] {
  appearance: none;
  padding-block: 0;
}