Bug 1862237 - Reset macOS menuitem spacing in toolbar menus. r=desktop-theme-reviewers,dao

Differential Revision: https://phabricator.services.mozilla.com/D192347
This commit is contained in:
Emilio Cobos Álvarez 2023-11-01 10:56:10 +00:00
parent 29531c0f31
commit 53234dc5bd
3 changed files with 20 additions and 15 deletions

View file

@ -249,6 +249,11 @@ toolbarseparator + .panel-subview-body {
margin-top: calc(-1 * (var(--panel-subview-body-padding-block) + var(--panel-shadow-margin) + 1px)); margin-top: calc(-1 * (var(--panel-subview-body-padding-block) + var(--panel-shadow-margin) + 1px));
} }
menuitem::before,
menuitem::after {
content: none; /* Reset's macOS' checkmark spacing */
}
:is(menu, menuitem)[disabled] { :is(menu, menuitem)[disabled] {
color: var(--panel-disabled-color); color: var(--panel-disabled-color);
} }

View file

@ -12,9 +12,9 @@ xul|tabs {
position: static; position: static;
} }
xul|menulist > xul|menupopup > xul|menuitem::after, xul|menupopup > xul|menuitem::after,
xul|menulist > xul|menupopup > xul|menuitem::before { xul|menupopup > xul|menuitem::before {
display: none; content: none;
} }
xul|menulist > xul|menupopup xul|menu, xul|menulist > xul|menupopup xul|menu,

View file

@ -94,13 +94,12 @@ menulist > menupopup > menu {
menupopup > menuitem { menupopup > menuitem {
padding-inline: 0; padding-inline: 0;
}
/* We only show the ::before pseudo-element, but we'd like the spacing to be /* We only show the ::before pseudo-element, but we'd like the spacing to be
* symmetric, so we render an invisible checkmark on both sides in order to * symmetric, so we render an invisible checkmark on both sides in order to
* reserve the right amount of space. */ * reserve the right amount of space. */
menupopup > menuitem::after, &::before,
menupopup > menuitem::before { &::after {
content: '\2713'; /* a checkmark */ content: '\2713'; /* a checkmark */
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@ -108,6 +107,7 @@ menupopup > menuitem::before {
visibility: hidden; visibility: hidden;
padding-inline: 4px; padding-inline: 4px;
} }
}
menupopup > menuitem:is([checked="true"], [selected="true"])::before { menupopup > menuitem:is([checked="true"], [selected="true"])::before {
visibility: inherit; visibility: inherit;