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

Update the inserter's block preview to use the AutoHeightPreview #20817

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ export class InserterMenu extends Component {
hoveredItem.initialAttributes
)
}
autoHeight
/>
</div>
) : (
Expand Down
14 changes: 3 additions & 11 deletions packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a variable here? Or at least something grid friendly like $grid-unit-60 * 3? I know no-one will really notice this, but I just don't like arbitrarily picked numbers :)

}

.block-editor-inserter__tips {
Expand Down