From 7552bf5b38b26329970a9de7de96122ac9b2c2e7 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 4 Dec 2024 18:25:40 +1100 Subject: [PATCH] This commit tweaks the change design dropdown to resemble the change design dropdown for the zoomed out section toolbar. --- .../src/query/edit/query-toolbar.js | 58 ++++++++++--------- packages/block-library/src/query/editor.scss | 22 ++++--- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/packages/block-library/src/query/edit/query-toolbar.js b/packages/block-library/src/query/edit/query-toolbar.js index 25e087ebe1559c..6f2c018cac993f 100644 --- a/packages/block-library/src/query/edit/query-toolbar.js +++ b/packages/block-library/src/query/edit/query-toolbar.js @@ -14,6 +14,10 @@ import { __ } from '@wordpress/i18n'; */ import PatternSelection, { useBlockPatterns } from './pattern-selection'; +const POPOVER_PROPS = { + placement: 'bottom-start', +}; + export default function QueryToolbar( { clientId, attributes } ) { const hasPatterns = useBlockPatterns( clientId, attributes ).length; if ( ! hasPatterns ) { @@ -21,31 +25,33 @@ export default function QueryToolbar( { clientId, attributes } ) { } return ( - - - ( - - { __( 'Change design' ) } - - ) } - renderContent={ () => ( - - ) } - /> - - + ( + + + { __( 'Change design' ) } + + + ) } + renderContent={ () => ( + + + + ) } + /> ); } diff --git a/packages/block-library/src/query/editor.scss b/packages/block-library/src/query/editor.scss index 5bf0db81870403..92521859ddc2a6 100644 --- a/packages/block-library/src/query/editor.scss +++ b/packages/block-library/src/query/editor.scss @@ -61,12 +61,11 @@ margin: 0; } -.block-editor-block-settings-menu__popover { - &.is-expanded { - overflow-y: scroll; - } - .block-library-query-pattern__selection-content { - height: 100%; +.block-library-query__toolbar-popover-content-wrapper { + padding: $grid-unit-15; + width: auto; + @include break-small() { + width: 320px; } .block-editor-block-patterns-list { display: grid; @@ -75,12 +74,11 @@ grid-template-columns: 1fr 1fr; } grid-gap: $grid-unit-15; - min-width: $break-zoomed-in; - @include break-small() { - min-width: $break-mobile; + .block-editor-block-patterns-list__list-item { + margin-bottom: 0; + } + .block-editor-inserter__media-list__list-item { + min-height: 100px; } - } - .block-editor-block-patterns-list__list-item { - margin-bottom: 0; } }