Skip to content

Spacer block: remove block gap from spacer block #38675

Closed

Description

@MaggieCabrera

What problem does this address?

Spacer blocks inside a container group block have the margin applied by the .wp-container-ID > * + * blockGap rules, this makes the height of the block always a bit bigger than what the user inputs in the editor and it's a bit inconsistent

Screenshot 2022-02-09 at 17 36 01

What is your proposed solution?

We should exclude the spacer block from this margin rule

Activity

  1. added
    [Block] Spacer
    on Feb 9, 2022
  2. Humanify-nl commented on Feb 9, 2022

    @Humanify-nl

    Good suggestion. Might I add, that my current solution is to substract the block gap value from the spacer. So as to always represent the exact space value in the input.

    But this probably works because I've built my own block with 4-5 fixed sizes (sm, md, lg, xl, etc) so my designer can sleep happily.

  3. richtabor commented on Apr 19, 2023

    @richtabor
    Member

    I've considered this as well, though it actually makes for less consistency — as all other blocks will have the blockGap value in play. Check this out:

    Every block has the same about of space between them:

    CleanShot 2023-04-19 at 18 25 42

    Now there's inconsistent space between the blocks, with the blockgap zeroed on the core/spacer

    CleanShot 2023-04-19 at 18 26 28

    The only way it maybe could work, is if the block after also has its blockGap value removed — but I'm not sure how much added benefit there is.

  4. added
    [Type] Enhancement
    Needs Design Feedback
    on Sep 14, 2023
  5. youknowriad commented on Sep 18, 2026

    @youknowriad
    Contributor

    As richtabor explained, excluding Spacer from block gap would make spacing inconsistent with every other block, so the gap applying to Spacer is intended. Closing as working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Design Feedback[Block] Spacer[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions