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
22 changes: 9 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,7 +406,7 @@
z-index: z-index(".block-editor-block-list__block {core/image aligned wide or fullwide}");

// Mover and settings above
> .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;
Expand All @@ -420,22 +420,23 @@
}
}

> .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 {
> .block-editor-block-list__block-edit > .block-editor-block-list__breadcrumb {
right: -$border-width;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a +1 px here solves the hover issue for me

Copy link
Member Author

@aduth aduth Apr 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a +1 px here solves the hover issue for me

I think it would effectively make it equivalent as right: 0; which sounds like what it should be (and conversely, the negative value could certainly explain the overflow). FWIW, I'm not able to reproduce the issue in Chrome, so I might imagine it's browser-specific.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs @kjellr input. Btw with the mover above, I think we could do with the hover label on the left again.

left: auto;
}

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

@include break-wide() {
> .block-editor-block-mover {
> .block-editor-block-list__block-edit > .block-editor-block-mover {
display: block;
}
}
Expand All @@ -452,18 +453,13 @@
// Wide
&[data-align="wide"] {
// Position mover
> .block-editor-block-mover {
> .block-editor-block-list__block-edit > .block-editor-block-mover {
left: -$block-padding + $border-width;
}
}

// Full-wide
&[data-align="full"] {
// Position hover label on the left for the top level block.
> .block-editor-block-list__block-edit > .block-editor-block-list__breadcrumb {
left: 0;
}

// Compensate for main container padding and subtract border.
@include break-small() {
margin-left: -$block-side-ui-width - $block-padding - $block-side-ui-clearance - $border-width;
Expand Down Expand Up @@ -494,7 +490,7 @@
}

// Position mover
> .block-editor-block-mover {
> .block-editor-block-list__block-edit > .block-editor-block-mover {
left: $border-width;
}
}
Expand Down Expand Up @@ -904,7 +900,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