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 removing block breadcrumbs #16506

Closed
wants to merge 3 commits 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
2 changes: 0 additions & 2 deletions assets/stylesheets/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $z-layers: (
".block-editor-block-list__block {core/image aligned wide or fullwide}": 20,
".block-library-classic__toolbar": 10,
".block-editor-block-list__layout .reusable-block-indicator": 1,
".block-editor-block-list__breadcrumb": 2,
".components-form-toggle__input": 1,
".components-panel__header.edit-post-sidebar__panel-tabs": -1,
".edit-post-sidebar .components-panel": -2,
Expand Down Expand Up @@ -59,7 +58,6 @@ $z-layers: (
// The toolbar, when contextual, should be above any adjacent nested block click overlays.
".block-editor-block-list__layout .reusable-block-edit-panel": 121,
".block-editor-block-contextual-toolbar": 121,
".editor-inner-blocks .block-editor-block-list__breadcrumb": 122,

// The block mover, particularly in nested contexts,
// should overlap most block content.
Expand Down
11 changes: 0 additions & 11 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import BlockInvalidWarning from './block-invalid-warning';
import BlockCrashWarning from './block-crash-warning';
import BlockCrashBoundary from './block-crash-boundary';
import BlockHtml from './block-html';
import BlockBreadcrumb from './breadcrumb';
import BlockContextualToolbar from './block-contextual-toolbar';
import BlockMultiControls from './multi-controls';
import BlockMobileToolbar from './block-mobile-toolbar';
Expand Down Expand Up @@ -372,8 +371,6 @@ function BlockListBlock( {
! showEmptyBlockSideInserter &&
! isPartOfMultiSelection &&
! isTypingWithinBlock;
const shouldShowBreadcrumb =
! isFocusMode && isHovered && ! isEmptyDefaultBlock;
const shouldShowContextualToolbar =
! hasFixedToolbar &&
! showEmptyBlockSideInserter &&
Expand Down Expand Up @@ -496,14 +493,6 @@ function BlockListBlock( {
onDragEnd={ onDragEnd }
/>
) }
{ shouldShowBreadcrumb && (
<BlockBreadcrumb
clientId={ clientId }
isHidden={
! ( isHovered || isSelected ) || hoverArea !== ( isRTL ? 'right' : 'left' )
}
/>
) }
{ ( shouldShowContextualToolbar || isForcingContextualToolbar.current ) && (
<BlockContextualToolbar
// If the toolbar is being shown because of being forced
Expand Down
78 changes: 0 additions & 78 deletions packages/block-editor/src/components/block-list/breadcrumb.js

This file was deleted.

61 changes: 0 additions & 61 deletions packages/block-editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,6 @@
}
}

// If the block movers are visible, push the breadcrumb down to make room for them.
.block-editor-block-mover.is-visible + .block-editor-block-list__breadcrumb {
top: (-$block-padding - $block-left-border-width - ($grid-size-small / 2));
}

// Align block toolbar to floated content.
@include break-mobile() {
.block-editor-block-toolbar {
Expand Down Expand Up @@ -481,10 +476,6 @@

// 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() {
Expand Down Expand Up @@ -988,58 +979,6 @@
}
}


/**
* Hover label
*/

.block-editor-block-list__breadcrumb {
position: absolute;
line-height: 1;
z-index: z-index(".block-editor-block-list__breadcrumb");

// Position in the top left of the border.
left: -$block-padding - $block-left-border-width;
top: (($block-padding * -2) - $block-left-border-width);

.components-toolbar {
border: none;
line-height: 1;
font-family: $default-font;
font-size: 11px;
padding: 4px 4px;
background: $light-gray-500;
color: $dark-gray-900;

.is-dark-theme & {
background: $dark-gray-600;
color: $white;
}

// Animate in
.block-editor-block-list__block:hover & {
opacity: 0;
@include edit-post__fade-in-animation(60ms, 0.5s);
}
}

// Position this above the toolbar of parent blocks.
.editor-inner-blocks & {
z-index: z-index(".editor-inner-blocks .block-editor-block-list__breadcrumb");
}

// Remove negative left breadcrumb position for left aligned blocks.
[data-align="left"] & {
left: 0;
}

// Right-align the breadcrumb for right-aligned blocks.
[data-align="right"] & {
left: auto;
right: 0;
}
}

.block-editor-block-list__descendant-arrow::before {
content: "→";
display: inline-block;
Expand Down
5 changes: 0 additions & 5 deletions packages/block-library/src/classic/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ div[data-type="core/freeform"] {
border-left-color: transparent;
}

// Don't show block type label for classic block
&.is-hovered .block-editor-block-list__breadcrumb {
display: none;
}

.editor-block-contextual-toolbar + div {
margin-top: 0;
padding-top: 0;
Expand Down
9 changes: 0 additions & 9 deletions packages/block-library/src/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,6 @@ div.block-core-columns.is-vertically-aligned-bottom {
justify-content: flex-end;
}


/**
* Fixes single Column breadcrumb to RHS of Block boundary
*/
[data-type="core/column"] > .editor-block-list__block-edit > .editor-block-list__breadcrumb {
right: 0;
left: auto;
}

/**
* Make single Column overlay not extend past boundaries of parent
*/
Expand Down