Skip to content

Commit 047e1e4

Browse files
committed
Improve border position for mobile screens, especially for elements that float left/right.
1 parent 130d84f commit 047e1e4

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

packages/block-editor/src/components/block-list/style.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
// Position toolbar better on mobile.
316316
.editor-block-contextual-toolbar {
317317
width: auto;
318-
border-bottom: $border-width solid $light-gray-500;
318+
border-bottom: $border-width solid $light-gray-800;
319319
bottom: auto;
320320
}
321321
}
@@ -833,11 +833,25 @@
833833
}
834834
}
835835

836-
// Floated items have special needs for the contextual toolbar position.
836+
// Floated items have special needs for the contextual toolbar position + the thicker left border.
837837
&[data-align="left"] .editor-block-contextual-toolbar,
838838
&[data-align="right"] .editor-block-contextual-toolbar {
839839
margin-bottom: $border-width;
840840
margin-top: -$block-toolbar-height;
841+
842+
// Display the box-shadow on the parent element.
843+
box-shadow: -$block-left-border-width 0 0 0 $dark-gray-500;
844+
.is-dark-theme & {
845+
box-shadow: -$block-left-border-width 0 0 0 $light-gray-600;
846+
}
847+
848+
@include break-small() {
849+
box-shadow: none;
850+
}
851+
852+
.editor-block-toolbar {
853+
border-left: none;
854+
}
841855
}
842856

843857
// Make block toolbar full width on mobile.

packages/block-editor/src/components/block-toolbar/style.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44
width: 100%;
55
overflow: auto; // Allow horizontal scrolling on mobile.
66
position: relative;
7+
border-left: $border-width solid $light-gray-800;
78
transition: border-color 0.1s linear, box-shadow 0.1s linear;
89

9-
// Allow overflow on desktop.
1010
@include break-small() {
11+
// Allow overflow on desktop.
1112
overflow: inherit;
12-
}
1313

14-
// Show a left border on the parent container.
15-
box-shadow: -$block-left-border-width 0 0 0 $dark-gray-500;
14+
// Show a left border on the parent container.
15+
border-left: none;
16+
box-shadow: -$block-left-border-width 0 0 0 $dark-gray-500;
1617

17-
// Show a lighter version for dark themes.
18-
.is-dark-theme & {
19-
box-shadow: -$block-left-border-width 0 0 0 $light-gray-600;
18+
// Show a lighter version for dark themes.
19+
.is-dark-theme & {
20+
box-shadow: -$block-left-border-width 0 0 0 $light-gray-600;
21+
}
2022
}
2123

2224
// The component is born with a border, but we only need some of them.

0 commit comments

Comments
 (0)