From d1ce74c6bc25930f4ac15f370bef0b7e42abcaa7 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 4 Dec 2024 18:25:40 +1100 Subject: [PATCH 1/2] 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; } } From 32be5ac1b61dc40bb6585d023af7835cc1f73695 Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 27 Dec 2024 13:59:03 +1100 Subject: [PATCH 2/2] Ensure mobile view stacks in full width --- packages/block-library/src/query/editor.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/editor.scss b/packages/block-library/src/query/editor.scss index 92521859ddc2a6..c95ab882a82b6a 100644 --- a/packages/block-library/src/query/editor.scss +++ b/packages/block-library/src/query/editor.scss @@ -64,7 +64,7 @@ .block-library-query__toolbar-popover-content-wrapper { padding: $grid-unit-15; width: auto; - @include break-small() { + @include break-medium() { width: 320px; } .block-editor-block-patterns-list {