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

[Try] Alternate design for block side controls #7211

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions edit-post/assets/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ $block-padding: 14px; // padding of nested blocks
$block-spacing: 4px; // vertical space between blocks

$block-side-ui-width: 28px; // width of the side UI, matches half matches half of a single line of text, so two buttons stacke matches 1
$block-side-ui-clearance: 2px; // space between side UI and block
$block-side-ui-padding: $block-side-ui-width + $block-side-ui-clearance; // total space used to accommodate side UI
$block-side-ui-clearance: 4px; // space between side UI and block
$block-side-ui-padding: $block-side-ui-width + $block-side-ui-clearance + 2px; // total space used to accommodate side UI
$block-parent-side-ui-clearance: $parent-block-padding - $block-padding; // space between side UI and block on top level blocks

// Buttons & UI Widgets
Expand Down
23 changes: 14 additions & 9 deletions editor/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
> .editor-block-list__breadcrumb {
right: -1px;
}

// compensate for main container padding, subtract border
@include break-small() {
margin-left: -$block-side-ui-padding + 1px;
Expand Down Expand Up @@ -514,11 +514,10 @@
// Left and right
> .editor-block-settings-menu,
> .editor-block-mover {
padding: $block-side-ui-clearance;
position: absolute;
top: 0;
width: $block-side-ui-width + $block-side-ui-clearance;
height: 100%; // stretch to fill half of the available space to increase hoverable area
max-height: $block-side-ui-width * 4; // stretch to fill half of the available space to increase hoverable area
width: $block-side-ui-width + ( $block-side-ui-clearance * 2 );
background: $white;
}

// Elevate when selected or hovered
Expand All @@ -528,9 +527,17 @@
&.is-hovered {
.editor-block-settings-menu,
.editor-block-mover {
outline: 1px solid $dark-opacity-light-500;
z-index: z-index( '.editor-block-list__block.is-{selected,hovered} .editor-block-{settings-menu,mover}' );
}
}

&.is-hovered {
.editor-block-settings-menu,
.editor-block-mover {
outline: 1px solid theme( outlines );
}
}
}

// Right side UI
Expand All @@ -555,8 +562,6 @@

// Left side UI
> .editor-block-mover {
padding-right: $block-side-ui-clearance;

// Position for top level blocks
left: -$block-side-ui-width - $block-side-ui-clearance - $block-parent-side-ui-clearance;

Expand Down Expand Up @@ -829,7 +834,7 @@
z-index: z-index( '.editor-block-list__breadcrumb' );

// Position in the top right of the border
right: -$block-parent-side-ui-clearance;
right: -10px;
top: 0;

// Nested
Expand All @@ -847,7 +852,7 @@
padding: 4px 4px;
background: theme( outlines );
color: $white;

// Animate in
.editor-block-list__block:hover & {
@include fade_in( .1s );
Expand Down
5 changes: 1 addition & 4 deletions editor/components/block-mover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,10 @@
// Apply a background in nested contexts, only on desktop
@include break-small() {
.editor-block-list__layout .editor-block-list__layout & {
background: $white;
box-shadow: inset 0 0 0 1px $light-gray-500;

&:first-child {
margin-bottom: -1px;
}

&:hover,
&:active,
&:focus {
Expand Down
8 changes: 3 additions & 5 deletions editor/components/block-settings-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
// Apply a background in nested contexts, only on desktop
@include break-small() {
.editor-block-list__layout .editor-block-list__layout & {
background: $white;
box-shadow: inset 0 0 0 1px $light-gray-500;
color: $dark-gray-500; // always show dark gray in nested contexts

//color: $dark-gray-500; // always show dark gray in nested contexts

&:first-child {
margin-bottom: -1px;
}
}

&:hover,
&:active,
Expand Down