Skip to content

Fix block styles missing in pattern creator editor canvas#740

Merged
bor0 merged 2 commits intoWordPress:trunkfrom
bor0:fix/block-styles-in-editor-canvas
Apr 7, 2026
Merged

Fix block styles missing in pattern creator editor canvas#740
bor0 merged 2 commits intoWordPress:trunkfrom
bor0:fix/block-styles-in-editor-canvas

Conversation

@bor0
Copy link
Copy Markdown
Member

@bor0 bor0 commented Apr 7, 2026

Summary

  • Enqueues block frontend style_handles via enqueue_block_assets so they are captured by _wp_get_iframed_editor_assets, which only picks up editor_style_handles and misses frontend styles needed by blocks like Cover for layout/background rendering.
  • Moves EditorStyles from the head prop of Iframe to inside the component as a child, so styles are injected within the canvas iframe.

Fixes #737

Test plan

  • Open the pattern creator and insert a Cover block — verify background/layout styles render correctly in the editor canvas.
  • Confirm no regressions in other blocks' styles inside the canvas.
  • Verify the editor still loads without JS errors.
Screenshot 2026-04-06 at 14 52 37 Screenshot 2026-04-06 at 14 52 41

Generated with Claude Code

bor0 and others added 2 commits April 7, 2026 11:51
Enqueue block frontend style_handles via enqueue_block_assets so they
are captured by _wp_get_iframed_editor_assets (which skips them in
favour of editor_style_handles). Also move EditorStyles inside the
Iframe component so styles render within the canvas.

Fixes #737

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@bor0 bor0 merged commit 15ba3c4 into WordPress:trunk Apr 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create pattern issue

1 participant