Automattic / Automattic/cortext

Let the data-view block declare its own editor styles

Open Beginner friendly
#304 0 comments 0 reactions 0 assignees View on GitHub
area: canvas type: code quality
Dominant language
JavaScript
Stars
51
Forks
2
Avg merge
3h 12m
Merged PRs (30d)
8

Description

The data-view block doesn't declare its styles in `block.json`, so WP won't carry them into the editor iframe on its own. We work around that in `Screen.php`, reading `build/editor.css` off disk and inlining it into the iframe's style list. It works, but there's a FIXME on it: we're hand-rolling what WP already does for any block that registers its own assets.

**Proposed solution:** give the block an `editorStyle` in `block.json` so WP loads it into the iframe, then drop the manual inlining in `Screen.php`.

Contributor guide

Open the contributing guide

Research direction

Start with the data-view block's block.json and inspect Screen.php, especially the code that reads build/editor.css and adds it to the iframe style list. Check how the block's existing assets are registered and confirm the editor iframe loads the declared style automatically. Done means the block declares editorStyle and the manual inlining workaround is removed without losing the editor styles.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, php
Domain
frontend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.