Skip to content

Commit

Permalink
Refactor making space for side panel by using :after
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Mar 29, 2024
1 parent 6dc5836 commit 284827c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ function InserterMenu(
);

return (
<div className="block-editor-inserter__menu">
<div
className={ classnames( 'block-editor-inserter__menu', {
'show-panel': showPatternPanel,
} ) }
>
<div
className={ classnames( 'block-editor-inserter__main-area', {
'show-as-tabs': showAsTabs,
Expand Down Expand Up @@ -305,9 +309,6 @@ function InserterMenu(
<InserterPreviewPanel item={ hoveredItem } />
</Popover>
) }
{ showPatternPanel && (
<div className="block-editor-inserter__pattern-panel-placeholder" />
) }
</div>
);
}
Expand Down
12 changes: 8 additions & 4 deletions packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,14 @@ $block-inserter-tabs-height: 44px;
display: flex;
}

.block-editor-inserter__pattern-panel-placeholder {
display: block;
width: 300px;
height: 100%;
.show-panel::after {
// Makes space for the inserter flyout panel
@include break-medium {
content: "";
display: block;
width: 300px;
height: 100%;
}
}

.block-editor-inserter__media-dialog {
Expand Down

0 comments on commit 284827c

Please sign in to comment.