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

Restore visual separator between mover buttons when show button label is on #57640

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
31 changes: 18 additions & 13 deletions packages/block-editor/src/components/block-toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,24 @@

.block-editor-block-mover .block-editor-block-mover__move-button-container {
width: auto;

@include break-small() {
position: relative;

&::before {
content: "";
height: $border-width;
width: 100%;
background: $gray-900;
position: absolute;
top: 50%;
left: 50%;
// With Top toolbar enabled, this separator has a smaller width. Translating the
// X axis allows to make the separator always centered regardless of its width.
transform: translate(-50%, 0);
margin-top: -$border-width * 0.5;
}
}
}

.block-editor-block-mover.is-horizontal {
Expand Down Expand Up @@ -231,19 +249,6 @@
padding-right: $grid-unit-15;
}

@include break-small() {
// Specificity override for https://github.com/WordPress/gutenberg/blob/try/block-toolbar-labels/packages/block-editor/src/components/block-mover/style.scss#L69
.is-up-button.is-up-button.is-up-button {
margin-right: 0;
border-radius: 0;
order: 1;
}

.is-down-button.is-down-button.is-down-button {
order: 2;
}
}

.block-editor-block-contextual-toolbar .block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button {
width: auto;
}
Expand Down
17 changes: 13 additions & 4 deletions packages/edit-post/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
margin-left: $grid-unit;
}

// Modified group borders
// Modified group borders.
.components-toolbar-group,
.components-toolbar {
border-right: none;
Expand Down Expand Up @@ -194,18 +194,27 @@
}

.show-icon-labels {

.edit-post-header__toolbar .block-editor-block-mover {
// Modified group borders.
border-left: none;

&::before {
content: "";
width: $border-width;
margin-top: $grid-unit + $grid-unit-05;
margin-bottom: $grid-unit + $grid-unit-05;
margin-top: $grid-unit-15;
margin-bottom: $grid-unit-15;
background-color: $gray-300;
margin-left: $grid-unit;
}

// Modified block movers horizontal separator.
.block-editor-block-mover__move-button-container {
&::before {
width: calc(100% - #{$grid-unit-30});
background: $gray-300;
left: calc(50% + 1px);
}
}
}
}

Expand Down
20 changes: 15 additions & 5 deletions packages/edit-site/src/components/header-edit-mode/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,26 @@ $header-toolbar-min-width: 335px;
}

.block-editor-block-mover {
// Modified group borders.
border-left: none;

&::before {
content: "";
width: $border-width;
margin-top: $grid-unit + $grid-unit-05;
margin-bottom: $grid-unit + $grid-unit-05;
margin-top: $grid-unit-15;
margin-bottom: $grid-unit-15;
background-color: $gray-300;
margin-left: $grid-unit;
}

// Modified block movers horizontal separator.
.block-editor-block-mover__move-button-container {
&::before {
width: calc(100% - #{$grid-unit-30});
background: $gray-300;
left: calc(50% + 1px);
}
}
}
}

Expand All @@ -164,16 +174,16 @@ $header-toolbar-min-width: 335px;
border-bottom: 0;
}

// Modified group borders
// Modified group borders.
.components-toolbar-group,
.components-toolbar {
border-right: none;

&::after {
content: "";
width: $border-width;
margin-top: $grid-unit + $grid-unit-05;
margin-bottom: $grid-unit + $grid-unit-05;
margin-top: $grid-unit-15;
margin-bottom: $grid-unit-15;
background-color: $gray-300;
margin-left: $grid-unit;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-widgets/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
border-bottom: 0;
}

// Modified group borders
// Modified group borders.
.components-toolbar-group,
.components-toolbar {
border-right: none;
Expand Down
Loading