Skip to content

Commit

Permalink
Fix mobile styles for inserter pattern and media tab navigation (Word…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj authored Jul 12, 2024
1 parent 7aca421 commit 9f8014a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
42 changes: 24 additions & 18 deletions packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -291,34 +291,35 @@ $block-inserter-tabs-height: 44px;
}

.block-editor-inserter__category-panel {
background: $gray-100;
border-top: $border-width solid $gray-200;
box-shadow: $border-width $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha.
outline: 1px solid transparent; // Shown for Windows 10 High Contrast mode.
position: absolute;
top: -$border-width;
left: 0;
height: calc(100% + #{$border-width});
width: 100%;
padding: 0 $grid-unit-20;
display: flex;
flex-direction: column;
padding: 0 $grid-unit-20;

@include break-medium {
border-left: $border-width solid $gray-200;
padding: 0;
left: 100%;
width: 300px;
}

.block-editor-inserter__media-list,
.block-editor-block-patterns-list {
padding: 0 $grid-unit-30 $grid-unit-20;
position: absolute;
top: -$border-width;
height: calc(100% + #{$border-width});
background: $gray-100;
border-top: $border-width solid $gray-200;
box-shadow: $border-width $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha.

.block-editor-inserter__media-list,
.block-editor-block-patterns-list {
padding: 0 $grid-unit-30 $grid-unit-20;
}
}
}

.block-editor-inserter__patterns-category-panel-header {
padding: $grid-unit-10 $grid-unit-30;
padding: $grid-unit-10 0;
@include break-medium {
padding: $grid-unit-10 $grid-unit-30;
}
}

.block-editor-inserter__patterns-category-no-results {
Expand Down Expand Up @@ -522,10 +523,15 @@ $block-inserter-tabs-height: 44px;
}

.block-editor-inserter__media-panel-search {
padding: $grid-unit-20 $grid-unit-30 $grid-unit-10;
margin-bottom: $grid-unit-20;
// TODO: Consider using the Theme component to automatically adapt to a gray background.
&:not(:focus-within) {
--wp-components-color-background: #{$white};
@include break-medium() {
margin-bottom: 0;
padding: $grid-unit-20 $grid-unit-30 $grid-unit-10;

&:not(:focus-within) {
--wp-components-color-background: #{$white};
}
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions packages/editor/src/components/inserter-sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@
}

.editor-inserter-sidebar__content {
// Leave space for the close button
height: calc(100% - #{$button-size} - #{$grid-unit-10});

@include break-medium() {
height: 100%;
}
height: 100%;
}

0 comments on commit 9f8014a

Please sign in to comment.