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

Show movers next to block switcher #22673

Merged
merged 15 commits into from
Jun 9, 2020
Prev Previous commit
Next Next commit
Move the dragging handle to the block toolbar styles.
  • Loading branch information
jasmussen authored and Joen Asmussen committed Jun 8, 2020
commit fd186673bf7452228ab9a69e294027deed2c273d
23 changes: 23 additions & 0 deletions packages/block-editor/src/components/block-toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,26 @@
display: block;
}
}

// Show a draggable handle when you're dragging using the toolbar component.
.components-draggable__clone {
margin-top: -$block-toolbar-height; // This puts it closer to the drag handle.

&::before {
content: "";
display: block;
position: absolute;
top: 0;
width: $button-size * 2;
height: $block-toolbar-height;
border-radius: $radius-block-ui;
background-color: $dark-gray-primary;
border: $border-width solid $dark-gray-primary;

// This should be reconsidered if successful.
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTcgMTYuNWgxMFYxNUg3djEuNXptMC05VjloMTBWNy41SDd6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);
background-size: $icon-size;
background-repeat: no-repeat;
background-position: center center;
}
}
19 changes: 0 additions & 19 deletions packages/components/src/draggable/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ body.is-dragging-components-draggable {
}

.components-draggable__clone {
margin-top: -$block-toolbar-height; // This puts it closer to the drag handle.
position: fixed;
padding: 20px;
background: transparent;
Expand All @@ -21,22 +20,4 @@ body.is-dragging-components-draggable {
> * {
opacity: 0.8;
}

&::before {
content: "";
display: block;
position: absolute;
top: 0;
width: $button-size * 2;
height: $block-toolbar-height;
border-radius: $radius-block-ui;
background-color: $dark-gray-primary;
border: $border-width solid $dark-gray-primary;

// This should be reconsidered if successful.
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTcgMTYuNWgxMFYxNUg3djEuNXptMC05VjloMTBWNy41SDd6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);
background-size: $icon-size;
background-repeat: no-repeat;
background-position: center center;
}
}