From 13cabfda05da7404be0279b45959b96c198f5ddd Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 12 Mar 2020 08:10:40 +0100 Subject: [PATCH 1/2] Update the inserter's block preview to use the AutoHeightPreview --- .../block-editor/src/components/inserter/menu.js | 1 + .../src/components/inserter/style.scss | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/block-editor/src/components/inserter/menu.js b/packages/block-editor/src/components/inserter/menu.js index c81e2956203b36..1cff0dd71c0737 100644 --- a/packages/block-editor/src/components/inserter/menu.js +++ b/packages/block-editor/src/components/inserter/menu.js @@ -502,6 +502,7 @@ export class InserterMenu extends Component { hoveredItem.initialAttributes ) } + autoHeight /> ) : ( diff --git a/packages/block-editor/src/components/inserter/style.scss b/packages/block-editor/src/components/inserter/style.scss index bda439f549b501..7aeb88319bad18 100644 --- a/packages/block-editor/src/components/inserter/style.scss +++ b/packages/block-editor/src/components/inserter/style.scss @@ -139,7 +139,6 @@ $block-inserter-search-height: 38px; display: none; border: $border-width solid $light-gray-secondary; width: 300px; - min-height: $block-inserter-preview-height; margin-right: 20px; padding: 20px; background: $white; @@ -150,8 +149,7 @@ $block-inserter-search-height: 38px; position: absolute; top: -$border-width; left: calc(100% + #{$grid-unit-15}); - display: flex; - flex-direction: column; + display: block; } .block-editor-block-card { @@ -160,12 +158,6 @@ $block-inserter-search-height: 38px; border-bottom: $border-width solid $light-gray-500; @include edit-post__fade-in-animation(); } - - .block-editor-inserter__preview { - display: flex; - flex-grow: 1; - overflow-y: auto; - } } .block-editor-inserter__menu-help-panel-no-block { @@ -213,10 +205,9 @@ $block-inserter-search-height: 38px; min-height: 150px; display: grid; flex-grow: 1; + align-items: center; .block-editor-block-preview__container { - margin-right: 0; - margin-left: 0; padding: 10px; } } @@ -229,6 +220,7 @@ $block-inserter-search-height: 38px; border: $border-width solid $light-gray-500; border-radius: $radius-round-rectangle; align-items: center; + min-height: 150px; } .block-editor-inserter__tips { From d1773e855a79201b76f96492d289f230e4231dd0 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 12 Mar 2020 09:58:03 +0100 Subject: [PATCH 2/2] Use Grid variables --- packages/block-editor/src/components/inserter/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/inserter/style.scss b/packages/block-editor/src/components/inserter/style.scss index 7aeb88319bad18..7adfb07c597f64 100644 --- a/packages/block-editor/src/components/inserter/style.scss +++ b/packages/block-editor/src/components/inserter/style.scss @@ -202,7 +202,7 @@ $block-inserter-search-height: 38px; .block-editor-inserter__preview-content { border: $border-width solid $light-gray-500; border-radius: $radius-round-rectangle; - min-height: 150px; + min-height: $grid-unit-60 * 3; display: grid; flex-grow: 1; align-items: center; @@ -220,7 +220,7 @@ $block-inserter-search-height: 38px; border: $border-width solid $light-gray-500; border-radius: $radius-round-rectangle; align-items: center; - min-height: 150px; + min-height: $grid-unit-60 * 3; } .block-editor-inserter__tips {