AdvancedCustomFields / AdvancedCustomFields/acf

Setting blockGap in block.json doesn't render the actual spacing

Open
#772 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Issue

When setting blockGap to true it doesn't seem to do anything in the front-end for ACF custom blocks.
The gap does not seem to change or do anything.

block.json configuration:

...

"supports": {
    "spacing": {
      "padding": true,
      "margin": true,
      "blockGap": true
    },
}

...

Expected behavior

A CSS style should be added to the block when you change the blockGap.
Below is an example when blockGap is being used on a native block.

This is the style that gets added to the block:

.editor-styles-wrapper .wp-container-11.wp-container-11 {
  gap: var(--wp--preset--spacing--40);
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing an ACF custom block using the shown block.json spacing supports and compare its front-end output with the native block example. Trace how blockGap is converted into a CSS style, then verify that changing blockGap produces a gap style on the rendered block.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.