Skip to content

Commit

Permalink
Fix columns full-wide regression. (#18021)
Browse files Browse the repository at this point in the history
The Columns block, when full-wide, has intentional left and right padding to ensure the mover controls of child blocks are accessible. This is editor-only, and only when the block is selected.

This regressed at some point, a while ago, probably around the introduction of extra on-click padding to show the dashed outlines of child elements.

This PR shuffles the rules a bit, reduces some of their specificity, and applies the left and right padding elsewhere to make it work.
  • Loading branch information
jasmussen authored and hypest committed Nov 4, 2019
1 parent a39d632 commit bea1b14
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions packages/block-library/src/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@
}
}

// 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.
[data-type="core/columns"][data-align="full"] .wp-block-columns > .editor-inner-blocks {
padding-left: $block-padding;
padding-right: $block-padding;

@include break-small() {
padding-left: $block-container-side-padding;
padding-right: $block-container-side-padding;
}
}

.wp-block-columns {
display: block;

Expand Down Expand Up @@ -188,10 +176,10 @@ div.block-core-columns.is-vertically-aligned-bottom {
/**
* Add extra padding when the parent block is selected, for easier interaction.
*/
.block-editor-block-list__layout .block-editor-block-list__block[data-type="core/columns"].is-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks,
.block-editor-block-list__layout .block-editor-block-list__block[data-type="core/columns"].has-child-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks,
.block-editor-block-list__layout .block-editor-block-list__block[data-type="core/column"].is-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks,
.block-editor-block-list__layout .block-editor-block-list__block[data-type="core/column"].has-child-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks {
[data-type="core/columns"].is-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks,
[data-type="core/columns"].has-child-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks,
[data-type="core/column"].is-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks,
[data-type="core/column"].has-child-selected > .block-editor-block-list__block-edit > [data-block] > div > .block-editor-inner-blocks {
padding: $block-padding;

// Negate this padding for the placeholder.
Expand All @@ -200,3 +188,16 @@ div.block-core-columns.is-vertically-aligned-bottom {
width: calc(100% + #{$block-padding * 2});
}
}


// 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.
[data-type="core/columns"][data-align="full"] .wp-block-columns {
padding-left: $block-padding;
padding-right: $block-padding;

@include break-small() {
padding-left: $block-container-side-padding;
padding-right: $block-container-side-padding;
}
}

0 comments on commit bea1b14

Please sign in to comment.