From f8ef8e21199f14a3ff17ad650ff338a2a30538c4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 28 Sep 2026 14:45:30 -0400 Subject: [PATCH] Match native pop-up button metrics for menulists on macOS 26+ Firefox has AppKit draw the menulist's capsule and chevron, but it sizes the box and positions the label itself, using a fixed dropdown border and the label's CSS margins. On macOS 27 (and probably 26), that left the label closer to the edges and the chevron than in a native NSPopUpButton. It also made the box 26.5px tall. Firefox assumes regular pop-up buttons are 22px tall and only draws them unscaled in boxes up to 2px taller, so it drew the control at 22px and scaled the image up, enlarging the capsule and chevron. Add padding to match native label insets, and trim the label's vertical margins to keep the box at 24px, so Firefox draws the control unscaled. The result measures the same as a native NSPopUpButton. --- scss/mac/components/_menulist.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scss/mac/components/_menulist.scss b/scss/mac/components/_menulist.scss index 56693661a4..c614c15d89 100644 --- a/scss/mac/components/_menulist.scss +++ b/scss/mac/components/_menulist.scss @@ -1,3 +1,17 @@ menulist { line-height: normal; } + +// Match the insets of native pop-up buttons on macOS 26+, which leave more room for the chevron +// than Firefox's dropdown border +@media (-moz-mac-tahoe-theme) { + menulist[native] { + padding-inline: 4px 11px; + + // Keep the height at 24px. Firefox scales up the control image when the box is taller + // than its natural height (22px) plus a 2px tolerance, making the chevron and bezel too big. + &::part(label) { + margin-block: 2px; + } + } +}