From dd32290c8fb3c9e405dee49dfcc68e765e5731fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAmjad?= Date: Sun, 29 Nov 2026 18:29:39 +0500 Subject: [PATCH] Keep grid columns on WordPress 7.2 by passing block gap as a var WordPress 7.2 checks the global blockGap with wp_sanitize_block_gap_value() before using it to size responsive grid columns. The check rejects any value containing "(" unless it is a single var(--name). Our fluid max(calc(clamp())) gap failed it, so core sized grid columns against a 0.5em fallback while the gap it draws stayed about 32px. Grids that set both a column count and a minimum column width then lost a column from 1024px up: three pricing cards became two plus one, two stats became one. The same formula now lives in settings.custom.block-gap, and blockGap points at it. A bare var() passes the check, and the gap keeps its exact value. 7.1 renders the same as before. --- theme.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/theme.json b/theme.json index 7544a29..851ab16 100644 --- a/theme.json +++ b/theme.json @@ -153,6 +153,7 @@ }, "custom": { "gap-scale": "var(--wp--custom--space-scale, 1)", + "block-gap": "max(4px, calc(clamp(1.5rem, 6vw, 2rem) * var(--wp--custom--gap-scale, 1)))", "color": { "neutral-50": "color-mix(in oklab, #F7F7F7, var(--wp--preset--color--primary, #1A1A1A) 6%)", "neutral-100": "color-mix(in oklab, #ECECEC, var(--wp--preset--color--primary, #1A1A1A) 6%)", @@ -2439,7 +2440,7 @@ } }, "spacing": { - "blockGap": "max(4px, calc(clamp(1.5rem, 6vw, 2rem) * var(--wp--custom--gap-scale, 1)))", + "blockGap": "var(--wp--custom--block-gap)", "padding": { "top": "0", "right": "var(--wp--preset--spacing--30)",