Automattic / Automattic/cortext
Let the data-view block declare its own editor styles
- 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
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