Skip to content

Commit

Permalink
Improve side UI for fullwide.
Browse files Browse the repository at this point in the history
Props for bugtesting, @jvisick

This adds padding left and right on fullwide columns. We can revisit this in the future.
  • Loading branch information
Joen Asmussen committed Apr 2, 2018
1 parent 4ea66e2 commit d60f648
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 19 additions & 2 deletions blocks/library/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
&:last-child {
margin-right: -$block-padding;
}
}

// This max-width is used to constrain the main editor column, it should not cascade into columns
.editor-block-list__block {
max-width: none;
}
}

.editor-block-list__block[data-align="full"] .wp-block-columns .editor-block-list__layout,
// Wide: show no left/right margin on wide, so they stack with the column side UI
.editor-block-list__block[data-align="wide"] .wp-block-columns .editor-block-list__layout {
&:first-child {
margin-left: 0;
Expand All @@ -20,3 +24,16 @@
margin-right: 0;
}
}

// Fullwide: show margin left/right to ensure there's room for the side UI
// This is not a 1:1 preview with the front-end where these margins would presumably be zero
// @todo this could be revisited, by for example showing this margin only when the parent block was selected first
// Then at least an unselected columns block would be an accurate preview
.editor-block-list__block[data-align="full"] .wp-block-columns .editor-block-list__layout {
&:first-child {
margin-left: $block-side-ui-padding;
}
&:last-child {
margin-right: $block-side-ui-padding;
}
}
4 changes: 2 additions & 2 deletions editor/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
margin-right: -$block-side-ui-padding;
}

.editor-block-list__block-edit {
> .editor-block-list__block-edit {
margin-left: -$block-padding;
margin-right: -$block-padding;

Expand All @@ -252,7 +252,7 @@
}
}

.editor-block-list__block-edit:before {
> .editor-block-list__block-edit:before {
left: 0;
right: 0;
border-left-width: 0;
Expand Down

0 comments on commit d60f648

Please sign in to comment.