Skip to content

Commit c668ce3

Browse files
committed
Bug 1967208 - Fix native menulist styling on Linux and Windows. r=desktop-theme-reviewers,sfoster
Make padding match buttons. Show the dropmarker properly too. Differential Revision: https://phabricator.services.mozilla.com/D250006 UltraBlame original commit: c6a876ea5024c2b4be4e43e22b0bc0abdee9ddad
1 parent 9dc9e4b commit c668ce3

File tree

4 files changed

+39
-63
lines changed

4 files changed

+39
-63
lines changed

toolkit/themes/linux/global/menulist.css

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,3 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
@import url("chrome://global/skin/menulist-shared.css");
6-
7-
:host([native]) {
8-
margin: 2px 4px;
9-
color: -moz-DialogText;
10-
font: menu;
11-
}
12-
13-
:host([native]:not([disabled="true"]):hover) {
14-
color: -moz-buttonhovertext;
15-
}
16-
17-
:host([native]:not([disabled="true"]):hover:active),
18-
:host([native]:not([disabled="true"])[open="true"]) {
19-
color: -moz-buttonactivetext;
20-
}
21-
22-
:host([native]) label {
23-
margin: 1px 3px;
24-
}
25-
26-
:host([native]) dropmarker {
27-
display: none;
28-
}

toolkit/themes/osx/global/menulist.css

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,3 @@
44

55
@import url("chrome://global/skin/menulist-shared.css");
66

7-
:host([native]) {
8-
margin: 5px 2px 3px;
9-
min-height: 20px;
10-
color: -moz-DialogText;
11-
}
12-
13-
:host([native]) #label-box {
14-
margin-bottom: 1px;
15-
}
16-
17-
:host([native]) label {
18-
margin: 1px 3px;
19-
}
20-
21-
:host([native]) dropmarker {
22-
display: none;
23-
}

toolkit/themes/shared/menulist-shared.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,45 @@
66
appearance: auto;
77
-moz-default-appearance: menulist;
88
text-shadow: none;
9+
@media (-moz-platform: linux) {
10+
font: menu;
11+
}
12+
@media (-moz-platform: linux) or (-moz-platform: windows) {
13+
margin: 2px 4px;
14+
color: ButtonText;
15+
padding: 2px 3px;
16+
border: 1px solid ThreeDLightShadow;
17+
18+
dropmarker {
19+
align-self: stretch;
20+
}
21+
}
22+
@media (-moz-platform: macos) {
23+
margin: 5px 2px 3px;
24+
min-height: 20px;
25+
color: -moz-DialogText;
26+
27+
#label-box {
28+
margin-bottom: 1px;
29+
}
30+
31+
label {
32+
margin: 1px 3px;
33+
}
34+
35+
dropmarker {
36+
display: none;
37+
}
38+
}
39+
}
40+
41+
@media (-moz-platform: linux) or (-moz-platform: windows) {
42+
:host([native]:where(:hover)) {
43+
color: -moz-buttonhovertext;
44+
}
45+
:host([native]:where(:hover:active, [open="true"])) {
46+
color: -moz-buttonactivetext;
47+
}
948
}
1049

1150
:host([native][disabled="true"]) {

toolkit/themes/windows/global/menulist.css

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,3 @@
44

55
@import url("chrome://global/skin/menulist-shared.css");
66

7-
:host([native]) {
8-
margin: 2px 4px;
9-
color: FieldText;
10-
}
11-
12-
@media (prefers-contrast) {
13-
:host([native]:not([open="true"]):focus) > #label-box {
14-
background-color: SelectedItem;
15-
color: SelectedItemText;
16-
}
17-
}
18-
19-
:host([native]:not([open="true"]):focus-visible) > #label-box {
20-
outline: var(--default-focusring);
21-
}
22-
23-
:host([native]) :is(image, label) {
24-
margin-block: -1px;
25-
}
26-
27-
:host([native]) dropmarker {
28-
margin-inline: 3px -3px;
29-
}

0 commit comments

Comments
 (0)