Skip to content

Commit

Permalink
Bug 1861468 - Perfectly align nesting menupopups' first menuitem is…
Browse files Browse the repository at this point in the history
… misaligned with its originating `menu` r=emilio,desktop-theme-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D191992
  • Loading branch information
ItielMaN committed Oct 27, 2023
1 parent 245fbaa commit 753f9ab
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions toolkit/themes/shared/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 753f9ab

Please sign in to comment.