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

Block Editor: Restore block movers to full-, wide-align blocks #15022

Merged
merged 7 commits into from
Apr 17, 2019
26 changes: 13 additions & 13 deletions packages/block-editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -406,36 +406,34 @@
z-index: z-index(".block-editor-block-list__block {core/image aligned wide or fullwide}");

// Mover and settings above
> .block-editor-block-mover {
&.is-multi-selected > .block-editor-block-mover,
> .block-editor-block-list__block-edit > .block-editor-block-mover {
// This moves the menu up by the height of the button + border + padding.
top: -$block-side-ui-width - $block-padding - $block-side-ui-clearance;
bottom: auto;
min-height: 0;
height: auto;
width: auto;
z-index: inherit;

&::before {
content: none;
}
}

> .block-editor-block-mover .block-editor-block-mover__control {
&.is-multi-selected > .block-editor-block-mover .block-editor-block-mover__control,
> .block-editor-block-list__block-edit > .block-editor-block-mover .block-editor-block-mover__control {
float: left;
}

// Position hover label on the right
> .block-editor-block-list__breadcrumb {
right: -$border-width;
}

// Hide mover until wide breakpoints, or it might be covered by toolbar
> .block-editor-block-mover {
&.is-multi-selected > .block-editor-block-mover,
> .block-editor-block-list__block-edit > .block-editor-block-mover {
display: none;
}

@include break-wide() {
> .block-editor-block-mover {
&.is-multi-selected > .block-editor-block-mover,
> .block-editor-block-list__block-edit > .block-editor-block-mover {
display: block;
}
}
Expand All @@ -452,7 +450,8 @@
// Wide
&[data-align="wide"] {
// Position mover
> .block-editor-block-mover {
&.is-multi-selected > .block-editor-block-mover,
> .block-editor-block-list__block-edit > .block-editor-block-mover {
left: -$block-padding + $border-width;
}
}
Expand Down Expand Up @@ -494,7 +493,8 @@
}

// Position mover
> .block-editor-block-mover {
&.is-multi-selected > .block-editor-block-mover,
> .block-editor-block-list__block-edit > .block-editor-block-mover {
left: $border-width;
}
}
Expand Down Expand Up @@ -904,7 +904,7 @@
}
}

.block-editor-block-list__block.is-focus-mode:not(.is-multi-selected) > .block-editor-block-contextual-toolbar {
.block-editor-block-list__block.is-focus-mode:not(.is-multi-selected) > .block-editor-block-list__block-edit > .block-editor-block-contextual-toolbar {
margin-left: -$block-side-ui-width;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/edit-post/src/components/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
margin-right: -$block-side-ui-width;
}

// Center the block toolbar on full-wide blocks.
// Center the block toolbar on wide and full-wide blocks.
// Use specific selector to not affect nested block toolbars.
&[data-align="wide"] > .block-editor-block-list__block-edit > .block-editor-block-contextual-toolbar,
&[data-align="full"] > .block-editor-block-list__block-edit > .block-editor-block-contextual-toolbar {
height: 0; // This collapses the container to an invisible element without margin.
width: calc(100% - 1px); // -1px to account for inner element left: 1px value causing overflow-x scrollbars
Expand Down