Skip to content

Commit

Permalink
Try: Add a clickable Group setup state (#40664)
Browse files Browse the repository at this point in the history
* Add basic selectable state.

* Fix height of row/stack.

* Rename default to flow.

* Fix for nested groups and rows.
  • Loading branch information
jasmussen committed Aug 15, 2022
1 parent 82615c0 commit 260521a
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions packages/block-library/src/group/editor.scss
Expand Up @@ -42,9 +42,9 @@
border: $border-width dashed currentColor;
opacity: 0.4;
border-radius: $radius-block-ui;
flex: 1;
flex: 1 0 $grid-unit-60;
pointer-events: none;
min-height: $grid-unit-60;
min-height: $grid-unit-60 - $border-width - $border-width;
}

// Let the parent be selectable in the placeholder area.
Expand All @@ -53,3 +53,28 @@
pointer-events: all;
}
}

// Show an unselected empty group button as a dashed outline instead of the appender button.
// This effectively adds a selectable-to-delete state.
.is-layout-flow.block-editor-block-list__block:not(.is-selected) {
> .block-list-appender:only-child {
pointer-events: none;

&::after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border: $border-width dashed currentColor;
opacity: 0.4;
border-radius: $radius-block-ui;
pointer-events: none;
}

.block-editor-inserter {
visibility: hidden;
}
}
}

0 comments on commit 260521a

Please sign in to comment.