Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add background color to menu items being hovered #13732

Merged
merged 4 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
color: $dark-gray-900;
border: none;
box-shadow: none;
background: $light-gray-200;
}

@mixin menu-style__focus() {
Expand All @@ -226,7 +227,7 @@
}

@mixin block-style__hover {
background: $light-gray-100;
background: $light-gray-200;
color: $dark-gray-900;
}

Expand Down
8 changes: 5 additions & 3 deletions packages/components/src/autocomplete/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
flex-grow: 1;
flex-shrink: 0;
align-items: center;
padding: 6px;
padding: 6px 8px;
margin-left: -3px;
margin-right: -3px;
text-align: left;

&.is-selected {
@include button-style__focus-active;
@include menu-style__focus;
}

&:hover {
@include button-style__hover;
@include menu-style__hover;
}
}
8 changes: 8 additions & 0 deletions packages/components/src/font-size-picker/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
top: calc(50% - 10px);
left: 10px;
}

&:hover {
@include menu-style__hover;
}

&:focus {
@include menu-style__focus;
}
}

.components-font-size-picker__buttons .components-font-size-picker__selector {
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/menu-group/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.components-menu-group {
width: 100%;
padding: $grid-size - $border-width;
padding: ($grid-size - $border-width) 0;
}

.components-menu-group__label {
margin-bottom: $grid-size;
color: $dark-gray-300;
padding: 0 ($grid-size - $border-width);
}
12 changes: 8 additions & 4 deletions packages/components/src/menu-item/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.components-menu-item__button,
.components-menu-item__button.components-icon-button {
width: 100%;
padding: 8px;
padding: $grid-size ($grid-size-large - $border-width);
text-align: left;
color: $dark-gray-600;

Expand All @@ -24,6 +24,10 @@
@include break-medium() {
@include menu-style__hover;
}

.components-menu-item__shortcut {
opacity: 1;
}
}

&:focus:not(:disabled):not([aria-disabled="true"]) {
Expand All @@ -39,15 +43,15 @@
.components-menu-item__info {
margin-top: $grid-size-small;
font-size: $default-font-size - 1px;
opacity: 0.82;
opacity: 0.84;
}

.components-menu-item__shortcut {
align-self: center;
opacity: 0.5;
opacity: 0.84;
margin-right: 0;
margin-left: auto;
padding-left: 8px;
padding-left: $grid-size;

// Hide the keyboard shortcuts on mobile, because they aren't super-useful
// for most mobile users and it frees up screen space for any item
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
// Hover States
.components-panel__body > .components-panel__body-title:hover,
.edit-post-last-revision__panel > .components-icon-button:not(:disabled):not([aria-disabled="true"]):not(.is-default):hover {
background: $light-gray-100;
background: $light-gray-200;
}

.components-panel__body-toggle.components-button {
Expand Down
7 changes: 3 additions & 4 deletions packages/editor/src/components/block-settings-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}

.editor-block-settings-menu__content {
padding: $grid-size - $border-width;
padding: ($grid-size - $border-width) 0;
}

.editor-block-settings-menu__separator {
margin-top: $grid-size;
margin-bottom: $grid-size;
margin-left: -$grid-size + $border-width;
margin-right: -$grid-size + $border-width;
margin-left: 0;
margin-right: 0;
border-top: $border-width solid $light-gray-500;

// Check if the separator is the last child in the node and if so, hide itself
Expand All @@ -36,7 +36,6 @@
.editor-block-settings-menu__control {
width: 100%;
justify-content: flex-start;
padding: 8px;
background: none;
outline: none;
border-radius: 0;
Expand Down