Skip to content

Commit

Permalink
Group: Zero out the intrinsic margin set to every block in the editor.
Browse files Browse the repository at this point in the history
This PR is a much smaller alternative to #22208. It sets the top and bottom margin of a group block to zero, in the editor only, to unset the margins that are otherwise inherited by the baseline margin that every block in the editor has.

This helps a great deal for when people create block patterns, where you might have several groups in a row, that should not have additional margin above and below.

Important also to remember that the margins of contents inside the group can still "bleed out" of the group, and even collapse with adjacent margins.

It would be nice to not have to unset these margins, and simply not have any margins in the first place. But per the discussions in #22208 removing those is nontrivial.
  • Loading branch information
jasmussen committed May 8, 2020
1 parent c9ce32f commit 2287669
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/group/editor.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/**
* Group: All Alignment Settings
*/

.wp-block[data-type="core/group"] {
// Zero out the baseline margin that is set for every block in the editor.
margin-top: 0;
margin-bottom: 0;

// Ensure not rendering outside the element
// as -1px causes overflow-x scrollbars
Expand Down

0 comments on commit 2287669

Please sign in to comment.