Skip to content

Commit

Permalink
Fix issues with wide and fullwide
Browse files Browse the repository at this point in the history
This fixes a few issues with wide and fullwide alignments. Props for reporting, @jvisick.

- Movers now work on wide and fullwide, and look good
- Hovering now both works without horizontal scrollbars on wide items, and they aren't overlapped by the movers
- Wide alignment blocks now don't have negative margin to accommodate side UI.
  • Loading branch information
Joen Asmussen committed Mar 29, 2018
1 parent b04100e commit 4ea66e2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
11 changes: 11 additions & 0 deletions blocks/library/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@
margin-right: -$block-padding;
}
}


.editor-block-list__block[data-align="full"] .wp-block-columns .editor-block-list__layout,
.editor-block-list__block[data-align="wide"] .wp-block-columns .editor-block-list__layout {
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
}
34 changes: 22 additions & 12 deletions editor/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

// Prevent collapsing margins @todo try and revisit this, it's conducive to theming to allow these to collapse
padding-top: .1px;
padding-bottom: .1px;
padding-bottom: .1px;
}

margin-bottom: $block-spacing;
Expand Down Expand Up @@ -259,34 +259,32 @@
border-right-width: 0;
}

.editor-block-mover {
// Adjust how movers behave on the full-wide block, and don't affect children
> .editor-block-mover {
display: none;
}

@include break-wide() {
.editor-block-mover {
> .editor-block-mover {
display: block;
top: -29px;
left: 10px;
height: auto;
width: auto;
z-index: inherit;

&:before {
content: none;
}
}

.editor-block-mover__control {
> .editor-block-mover .editor-block-mover__control {
float: left;
margin-right: 8px;
}
}

.editor-block-settings-menu__control {
float: left;
margin-right: 8px;
}

.editor-block-settings-menu {
// Also adjust block settings menu
> .editor-block-settings-menu {
top: -41px;
right: 10px;
height: auto;
Expand All @@ -295,6 +293,10 @@
content: none;
}
}

> .editor-block-settings-menu .editor-block-settings-menu__control {
float: left;
}
}

// Clear floats
Expand Down Expand Up @@ -555,8 +557,15 @@
margin-right: -$block-padding - 1px;

@include break-small() {
margin-left: -$block-padding - $block-side-ui-padding - 1px; // stack borders
// stack borders
margin-left: -$block-padding - $block-side-ui-padding - 1px;
margin-right: -$block-padding - $block-side-ui-padding - 1px;

// except for wide elements, this causes a horizontal scrollbar
[data-align="full"] & {
margin-left: -$block-padding - $block-side-ui-padding;
margin-right: -$block-padding - $block-side-ui-padding;
}
}

// on mobile, toolbars fix differently
Expand All @@ -569,6 +578,7 @@
& > * {
pointer-events: auto;
}

}

.editor-block-contextual-toolbar .editor-block-toolbar,
Expand Down

0 comments on commit 4ea66e2

Please sign in to comment.