-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI Components: Refactor BlockSettingsMenu and MoreMenu as DropdownMenu (
#14843) * Components: Document missing menuLabel, position, className Dropdown props * Components: Add render prop support to DropdownMenu * Block Editor: Refactor BlockSettingsMenu as DropdownMenu * CHANGELOG 7a54cec * CHANGELOG 743e4da * CHANGELOG ea82658 * Components: Remove unintended tabs from DropdownMenu tests * Refactor MoreMenu component to use DropdownMenu component * Use single label for DrowdownMenu components * Fix all failing e2e tests * Add all class names for backward compatibility * Fix unit tests by refreshing saved snapshots * Update packages/components/src/menu-group/index.js Co-Authored-By: gziolo <grzegorz@gziolo.pl> * Add back removed changelog update for components during rebase * Mark all props used with DropdownMenu for backward compatibility as unstable * Remove obsolete DropdownMenuSepararator component * Apply changes after rebase to align CSS styles with master * Display dropdown menu indicator only when icon set expliclity to false
- Loading branch information
Showing
25 changed files
with
391 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 4 additions & 56 deletions
60
packages/block-editor/src/components/block-settings-menu/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,7 @@ | ||
.block-editor-block-settings-menu__toggle .dashicon { | ||
transform: rotate(90deg); | ||
.block-editor-block-settings-menu__content { | ||
padding: 0; | ||
} | ||
|
||
// Popout menu | ||
.block-editor-block-settings-menu__popover { | ||
&::before, | ||
&::after { | ||
margin-left: 2px; | ||
} | ||
|
||
.block-editor-block-settings-menu__content { | ||
padding: ($grid-size - $border-width) 0; | ||
} | ||
|
||
.block-editor-block-settings-menu__separator { | ||
margin-top: $grid-size; | ||
margin-bottom: $grid-size; | ||
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 | ||
&:last-child { | ||
display: none; | ||
} | ||
} | ||
|
||
.block-editor-block-settings-menu__title { | ||
display: block; | ||
padding: 6px; | ||
color: $dark-gray-300; | ||
} | ||
|
||
// Menu items | ||
.block-editor-block-settings-menu__control { | ||
width: 100%; | ||
justify-content: flex-start; | ||
background: none; | ||
outline: none; | ||
border-radius: 0; | ||
text-align: left; | ||
cursor: pointer; | ||
color: $dark-gray-600; | ||
@include menu-style__neutral; | ||
|
||
&:hover:not(:disabled):not([aria-disabled="true"]) { | ||
@include menu-style__hover; | ||
} | ||
|
||
&:focus:not(:disabled):not([aria-disabled="true"]) { | ||
@include menu-style__focus; | ||
} | ||
|
||
.dashicon { | ||
margin-right: 5px; | ||
} | ||
} | ||
.block-editor-block-settings-menu__toggle .dashicon { | ||
transform: rotate(90deg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.