From 753f9abacea74bdafb8418529034f791aad6df09 Mon Sep 17 00:00:00 2001 From: Itiel Date: Fri, 27 Oct 2023 14:29:52 +0000 Subject: [PATCH] Bug 1861468 - Perfectly align nesting menupopups' first `menuitem` is misaligned with its originating `menu` r=emilio,desktop-theme-reviewers Differential Revision: https://phabricator.services.mozilla.com/D191992 --- toolkit/themes/shared/popup.css | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/toolkit/themes/shared/popup.css b/toolkit/themes/shared/popup.css index b585e83c06232..c85535c068b0a 100644 --- a/toolkit/themes/shared/popup.css +++ b/toolkit/themes/shared/popup.css @@ -106,35 +106,31 @@ panel { } } -@media (-moz-platform: linux) or (-moz-platform: windows) { - menupopup { +menupopup { + @media (-moz-platform: linux) or (-moz-platform: windows) { /* Also apply the padding in the inline axis for menus */ --panel-padding: var(--panel-padding-block); } - menupopup > menu > menupopup { - /* Vertically align nested menupopups: the shadow plus the top padding */ - margin-top: calc(-1 * (var(--panel-shadow-margin) + var(--panel-padding-block))); - } -} -@media (-moz-platform: macos) { - menupopup { + @media (-moz-platform: macos) { --panel-padding-block: 4px; } - menupopup > menu > menupopup { - margin-top: -4px; + + @media (-moz-platform: windows) { + > menu, + > menuitem { + padding-block: 0.5em; + padding-inline-start: 1em; + } } -} -@media (-moz-platform: windows) { - menupopup > menuitem, - menupopup > menu { - padding-block: 0.5em; - padding-inline-start: 1em; + > menu > menupopup { + /* Vertically align nested menupopups: the shadow plus the top padding plus top border */ + margin-top: calc(-1 * (var(--panel-shadow-margin) + var(--panel-padding-block) + 1px)); } } -/* rules for popups associated with menulists */ +/* Rules for popups associated with menulists */ menulist > menupopup { min-width: 0;