Description
When styles.spacing.blockGap in theme.json uses a nested CSS variable with fallback, adjusting the column-gap or row-gap control produces invalid CSS.
Step-by-step reproduction instructions
- Install WordPress 7.0 beta2 (or RC2)
- Modify TT5 theme.json:
{
"styles": {
"spacing": {
"blockGap": "var(--a, var(--b, 1.2rem))"
}
}
}
- Ensure styles.spacing.blocks.core/columns is not set
- Insert a Columns block
- Confirm initial gap is correctly applied:
gap: var(--a, var(--b, 1.2rem));
- Adjust column-gap using the block settings UI
Screenshots, screen recording, code snippet
column-gap not set:

Column gap is configured:

The resulting CSS should remain valid, e.g.:
gap: var(--a, var(--b, 1.2rem)) var(--wp--preset--spacing--40);
The generated CSS becomes invalid, for example:
gap: var(--b, var(--wp--preset--spacing--40)
- The outer var() is partially lost
- Parentheses become unbalanced
- Resulting CSS is syntactically broken
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
Description
When
styles.spacing.blockGapintheme.jsonuses a nested CSS variable with fallback, adjusting the column-gap or row-gap control produces invalid CSS.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
column-gap not set:

Column gap is configured:

The resulting CSS should remain valid, e.g.:
The generated CSS becomes invalid, for example:
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.