5 Comments

  1. Marcy Diaz
    · Reply

    I just ran into the blockGap issue after updating to Gutenberg 11.4. (I wouldn’t even have it installed, except that I just converted my theme to a FSE theme.)

    It’s applied in a really aggressive manner, and removing it from a particular section (<header>, for instance, which needs top and bottom padding and no margin) seems to be a bit of a CSS challenge.

    Report

    • Justin Tadlock
      · Reply

      I think some of your code was cut off by the comment filtering system here. Just going out on a limb here since you mentioned <header> that you may be dealing with the first-child issue.

      You should be able to set margins for individual blocks too. So, for a Group (assuming that’s what you’re using), you just add a 0 margin for it. I haven’t actually tested to make sure blockGap isn’t overwriting that though.

      Report

  2. Marcy Diaz
    · Reply

    Thanks, Justin.
    That’s what I ended up doing – adding 0 margin.

    I’m not sure if this CSS will come through in the comments, but the blockGap is added with the CSS below, and it actually added 2 sets of 24px to the top of the sections (24px is the Gutenberg default). Anyway, I’ll get the CSS all organized the way I want eventually.

    .wp-site-blocks > * + * {
        margin-top: var( --wp--style--block-gap );
        margin-bottom: 0;
    }

    Report

  3. Andrew
    · Reply

    I take a few days (mostly) off-grid bikepacking around the Highlands after what seems like a loooong 18 months, and completely miss this Block Gap thingy.

    IMO it needs to be opt-in or at the very least opt-out without merely setting styles.spacing.blockGap to zero. Additionally it needs to be adjustable/removable on a block-by-block basis.

    There are going to be countless times when a gap is not wanted, for example multiple Group Blocks each with a background color, you usually doesn’t want any white space between them.

    Trying to get into the mindset of a non-developer, I can envision users being flumoxed when they are presented with a gap they didn’t expect, and have no obvious way of removing.

    Report

  4. Bobby Thompson
    · Reply

    I was trying to do block gap stuff with Heydon Pickering’s lobotomized owl selector.

    Report

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: