Skip to content

Commit

Permalink
improve the responsiveness of the fixed block toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jun 30, 2023
1 parent 259d3f1 commit a3b27fe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
15 changes: 11 additions & 4 deletions packages/block-editor/src/components/block-tools/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,18 @@
// has to be flex for collapse button to fit
display: flex;

//hide overflow and scroll
overflow: hidden;
overflow-x: scroll;

&.is-collapsed {
width: initial;
}

.is-fullscreen-mode & {
// leave room for block inserter, undo and redo, list view
// and some margin left
margin-left: $grid-unit-80 * 4 - 2 * $grid-unit + $grid-unit-05;
margin-left: $grid-unit-80 * 4 - 2 * $grid-unit;
top: $grid-unit - $border-width;
&.is-collapsed {
width: initial;
Expand All @@ -170,7 +174,7 @@
margin-right: 0;
background-color: $gray-300;
position: relative;
left: -$grid-unit-05;
left: math.div(-$grid-unit-05, 2);
top: -1px;
}
}
Expand Down Expand Up @@ -210,6 +214,7 @@
border: none;

.show-icon-labels & {
width: $grid-unit-80 * 4;
.components-button.has-icon {
// Hide the button icons when labels are set to display...
svg {
Expand All @@ -231,7 +236,7 @@
margin-bottom: $grid-unit + $grid-unit-05;
background-color: $gray-300;
position: relative;
left: -10px;
left: -8px;
height: 3 * $grid-unit;
top: -1px;
}
Expand Down Expand Up @@ -321,7 +326,9 @@
// for the block inserter the publish button
@include break-large() {
&.is-fixed {
width: initial;
// the combined with of the tools at the right of the header and the margin left
// of the toolbar which includes four buttons
width: calc(100% - 240px - #{4 * $grid-unit-80});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
color: currentColor;
background: $gray-200;
}

@include break-medium() {
width: 50%;
}

@include break-large() {
width: min(100%, 450px);
}
}

.edit-site-document-actions__command {
Expand Down
12 changes: 0 additions & 12 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
color: $gray-400;
display: flex;
flex-direction: column;

// Expand the fixed block toolbar to cover the document title control.
.block-editor-block-contextual-toolbar {
@include break-medium() {
&.is-fixed {
// the combined with of the tools at the right of the header and the margin left
// of the toolbar which includes four buttons
width: calc(100% - 240px - #{4 * $grid-unit-80});
}
}
}

}

.edit-site-layout__hub {
Expand Down

0 comments on commit a3b27fe

Please sign in to comment.