Skip to content

Commit

Permalink
Polish grid further (#23)
Browse files Browse the repository at this point in the history
* Show column resize handles only when allowed, and show grid on children also.

* Fix margin issue.

* Add some list item stuff.
  • Loading branch information
Joen Asmussen authored Jan 23, 2020
1 parent a2b2b37 commit 25cb367
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions blocks/layout-grid/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@
margin-bottom: 0;
padding-left: 0;

li {
margin-left: 0;
padding-left: 0;
list-style: none;
}

> li .components-button {
list-style: none;
flex-shrink: 1;
Expand Down
3 changes: 2 additions & 1 deletion blocks/layout-grid/src/grid-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
// constantly "refresh" this hack.
position: relative;
.is-hovered &,
.is-selected & {
.is-selected &,
.has-child-selected & {
position: absolute;
}

Expand Down
2 changes: 1 addition & 1 deletion blocks/layout-grid/src/grid-resize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

// Every block, including nested blocks, are born with an intrinsic minimum margin.
// This resets that for the containers, which aren't meant to have that intrinsically.
> .wp-block > .editor-block-list__block-edit > [data-block] {
> .wp-block > .block-editor-block-list__block-edit > [data-block] {
margin-top: 0;
margin-bottom: 0;
}
Expand Down
6 changes: 3 additions & 3 deletions blocks/layout-grid/src/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// Every block, including nested blocks, are born with an intrinsic minimum margin.
// This resets that for the containers, which aren't meant to have that intrinsically.
> .wp-block > .editor-block-list__block-edit > [data-block] {
> .wp-block > .block-editor-block-list__block-edit > [data-block] {
margin-top: 0;
margin-bottom: 0;
}
Expand Down Expand Up @@ -127,7 +127,7 @@
}

[data-type="jetpack/layout-grid"].is-selected .wp-block-jetpack-layout-resizable .wp-blocks-jetpack-layout-grid__resize-handles .components-resizable-box__handle,
[data-type="jetpack/layout-grid"] [data-type="jetpack/layout-grid-column"].is-selected .wp-blocks-jetpack-layout-grid__resize-handles .components-resizable-box__handle {
[data-type="jetpack/layout-grid"] .wp-block-jetpack-layout-resizable [data-type="jetpack/layout-grid-column"].is-selected .wp-blocks-jetpack-layout-grid__resize-handles .components-resizable-box__handle {
display: block;
}

Expand Down Expand Up @@ -161,7 +161,7 @@ $light-opacity-light-800: rgba(#fff, 0.45);
}
}

/* When clicked, hide the fake drag handles and show the real one */
// When clicked, hide the fake drag handles and show the real one.
.wp-block-jetpack-layout-grid__resizing {
user-select: none;
z-index: 10000;
Expand Down

0 comments on commit 25cb367

Please sign in to comment.