You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spacer block: remove block gap from spacer block #38675
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
What is your proposed solution?
We should exclude the spacer block from this margin rule
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.
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:
Now there's inconsistent space between the blocks, with the blockgap zeroed on the core/spacer
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.
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.
Activity
Humanify-nl commentedon Feb 9, 2022
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.
richtabor commentedon Apr 19, 2023
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:
Now there's inconsistent space between the blocks, with the blockgap zeroed on the core/spacer
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.
youknowriad commentedon Sep 18, 2026
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.