Repository navigation
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @realthemes. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Closes #69492
Why?
blockGap set in theme.json under styles.spacing.blockGap has no visible effect in template thumbnails on the Site Editor's Templates list page. The thumbnails look flat/unspaced even when the full template editor renders the gap correctly.
Root cause: The CSS that drives blockGap targets .wp-site-blocks:
:root :where(.wp-site-blocks) > * { margin-block-start: ; margin-block-end: 0; }
The full template editor passes className="wp-site-blocks" to BlockList in VisualEditor. But the template thumbnail path — BlockPreview → AutoBlockPreview → ScaledBlockPreview — renders BlockList with no className, so the selector never matches inside the preview iframe and the gap is invisible.
Fix: Pass className="wp-site-blocks" to MemoizedBlockList in ScaledBlockPreview (packages/block-editor/src/components/block-preview/auto.js), bringing it in line with what VisualEditor already does.
How?
The fix is a single change in ScaledBlockPreview (packages/block-editor/src/components/block-preview/auto.js):
Testing Instructions
Before this fix: thumbnails showed no gap between blocks regardless of what blockGap was set to in theme.json.
After this fix: thumbnails reflect the correct blockGap spacing, matching what you see when opening the template in the full editor.
Use of AI Tools
Claude Code