Skip to content

Commit

Permalink
Fix menu item colors
Browse files Browse the repository at this point in the history
Fixes #15387

This PR fixes an inconsistency in menu item colors. There were some redundant CSS that had not been cleaned up properly with the move to the color mixins.

Additionally it replaces the use of opacity for the lighter text in the menus, and uses the color variables instead, as those colors do not need to work on differently colored backgrounds, just white.
  • Loading branch information
Joen Asmussen committed May 9, 2019
1 parent 7e0dce0 commit 2c33471
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
@mixin menu-style__neutral() {
border: none;
box-shadow: none;
color: $dark-gray-600;
}

@mixin menu-style__hover() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
background: none;
outline: none;
border-radius: 0;
color: $dark-gray-500;
text-align: left;
cursor: pointer;
@include menu-style__neutral;
Expand Down
9 changes: 4 additions & 5 deletions packages/components/src/menu-item/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
width: 100%;
padding: $grid-size ($grid-size-large - $border-width);
text-align: left;
color: $dark-gray-600;
@include menu-style__neutral;

// Target plugin icons that can have arbitrary classes by using an aggressive selector.
.dashicon,
Expand All @@ -18,15 +18,14 @@
}

&:hover:not(:disabled):not([aria-disabled="true"]) {
color: $dark-gray-500;
// Disable hover style on mobile to prevent odd scroll behaviour.
// See: https://github.com/WordPress/gutenberg/pull/10333
@include break-medium() {
@include menu-style__hover;
}

.components-menu-item__shortcut {
opacity: 1;
color: $dark-gray-600;
}
}

Expand All @@ -43,12 +42,12 @@
.components-menu-item__info {
margin-top: $grid-size-small;
font-size: $default-font-size - 1px;
opacity: 0.84;
color: $dark-gray-300;
}

.components-menu-item__shortcut {
align-self: center;
opacity: 0.84;
color: $dark-gray-300;
margin-right: 0;
margin-left: auto;
padding-left: $grid-size;
Expand Down

0 comments on commit 2c33471

Please sign in to comment.