Skip to content

Commit

Permalink
Bug 1861648 - Use less !important in menu styling. r=desktop-theme-re…
Browse files Browse the repository at this point in the history
…viewers,dao

It just forces everything that needs to override it to be !important,
which is not great.

Differential Revision: https://phabricator.services.mozilla.com/D192073
  • Loading branch information
emilio committed Oct 30, 2023
1 parent fcbb654 commit 1db5d00
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 36 deletions.
6 changes: 0 additions & 6 deletions browser/themes/linux/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,6 @@ menuitem.bookmark-item {
margin-bottom: -10px;
}

#context-navigation > .menuitem-iconic > .menu-iconic-left {
/* override toolkit/themes/linux/global/menu.css */
padding-inline-end: 0 !important;
margin-inline-end: 0 !important;
}

/* The button box must appear on top of the navigator-toolbox in order for
* click and hover mouse events to work properly for the button in the restored
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
Expand Down
12 changes: 6 additions & 6 deletions browser/themes/shared/customizableui/panelUI-shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@ toolbarseparator + .panel-subview-body {
.menu-right {
/* Reset every spacing and appearance set by the platforms' menu.css
* and set the ones we need in the following rules. */
margin: 0 !important;
padding: 0 !important;
appearance: none !important;
margin: 0;
padding: 0;
appearance: none;
}

:is(.menu-iconic, .menuitem-iconic) > .menu-iconic-left {
margin-inline-end: 8px !important;
margin-inline-end: 8px;
}

.menu-accel,
.menu-iconic-accel {
margin-inline-start: 16px !important;
margin-inline-start: 16px;
}

menu > .menu-right {
Expand All @@ -310,7 +310,7 @@ toolbarseparator + .panel-subview-body {
}

:is(.toolbar-menupopup, .toolbar-menupopup menupopup)[emptyplacesresult] > menuitem > .menu-accel-container > .menu-accel {
margin: 0 !important;
margin: 0;
}

#confirmation-hint {
Expand Down
27 changes: 9 additions & 18 deletions toolkit/themes/linux/global/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,21 @@ menulist > menupopup > :is(menuitem, menucaption, menu) {

.menu-text,
.menu-iconic-left,
.menu-iconic-text {
margin-top: 0 !important;
margin-bottom: 0 !important;
margin-inline-start: 0 !important;
margin-inline-end: 2px !important;
.menu-iconic-text,
.menubar-left {
margin-block: 0;
margin-inline: 0 2px;
}

.menu-text {
/* This is (18 + the size of end-padding on .menu-iconic-left)px */
margin-inline-start: 21px !important;
margin-inline-start: 21px;
}

.menu-accel,
.menu-iconic-accel {
margin-top: 0 !important;
margin-bottom: 0 !important;
margin-inline-start: 7px !important;
margin-block: 0;
margin-inline-start: 7px;
}

.menu-accel-container {
Expand All @@ -70,23 +68,16 @@ menulist > menupopup > :is(menuitem, menucaption, menu) {
.menu-iconic-left {
min-width: 16px;
/* We can only hardcode this, to make the default GTK icon<->label spacing */
padding-inline-end: 3px !important;
padding-inline-end: 3px;
}

.menu-iconic-icon {
width: 16px;
height: 16px;
}

.menubar-left {
margin-top: 0;
margin-bottom: 0;
margin-inline-start: 0;
margin-inline-end: 2px;
}

.menubar-text {
margin: 0 1px !important;
margin: 0 1px;
}

menulist > menupopup > :is(menuitem, menucaption, menu) > .menu-iconic-left {
Expand Down
4 changes: 2 additions & 2 deletions toolkit/themes/osx/global/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.menu-iconic-text,
.menu-accel,
.menu-iconic-accel {
margin: 0 !important;
margin: 0;
}

.menu-iconic-icon {
Expand Down Expand Up @@ -68,7 +68,7 @@ menubar > menu[_moz-menuactive="true"][open="true"] {
}

.menubar-text {
margin: 0 1px !important;
margin: 0 1px;
}

/* menu/menuitems in popups */
Expand Down
8 changes: 4 additions & 4 deletions toolkit/themes/windows/global/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ menubar > menu:-moz-window-inactive {
.menu-iconic-accel,
.menu-text,
.menu-iconic-text {
margin: 0 !important;
margin: 0;
padding: 1px 0;
}

.menu-accel,
.menu-iconic-accel {
margin-inline: 0.74em 1.35em !important;
margin-inline: 0.74em 1.35em;
}

.menu-iconic-icon {
Expand Down Expand Up @@ -69,7 +69,7 @@ menubar > menu:-moz-lwtheme[_moz-menuactive="true"]:not([disabled="true"]) {
/* ..... internal content .... */

.menubar-text {
margin: 1px 6px 2px !important;
margin: 1px 6px 2px;
}

/* ::::: menu/menuitems in menulist popups ::::: */
Expand Down Expand Up @@ -102,7 +102,7 @@ menulist > menupopup > menuitem[_moz-menuactive="true"][disabled="true"] {
}

menulist > menupopup > :is(menuitem, menucaption):not(.menuitem-iconic) > .menu-iconic-text {
margin: 0 !important;
margin: 0;
}

/* ::::: checkbox and radio menuitems ::::: */
Expand Down

0 comments on commit 1db5d00

Please sign in to comment.