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
#22209)

* Group: Zero out the intrinsic margin set to every block in the editor.

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.

* Address feedback.
  • Loading branch information
jasmussen committed May 11, 2020
1 parent 864f954 commit af44574
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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"] {

.wp-block-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 af44574

Please sign in to comment.