refactor: vendor the default editor styles stylesheet - #600
Conversation
Gutenberg #81793 removed `default-editor-styles.scss` from the `@wordpress/block-editor` package. The stylesheet still ships in the pinned version, so nothing breaks today, but the next package bump including the removal would break the build. Copy the stylesheet into the repo and import it locally, matching the approach already used for `default-theme-styles.scss` and `wp-common-styles.scss`. The compiled output is unchanged from the package's `build-style` version. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZ5JzgG1CKQwmSN2P3B4R6
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/600")Built from de038d8 |
The previous post title selector was incorrect, and the unused styles were not as fitting for smaller screens.
|
@dcalhoun I deactivated the Gutenberg plugin on my test site, and when I tried the iOS demo app with that site it never loaded - I was stuck with a progress spinner in the middle of the screen. However, the next time I tried it loaded just fine. I asked Claude to investigate and here's what it reported:
|
|
@nbradbury thanks for reviewing. I don't believe the hang you experienced relates to the changes in the PR. Also, I'm unsure Claude's reported cause holds. When a site lacks the Gutenberg plugin, then it lacks the There is one context where a 404 can occur for the GBK Demo app due to its rudimentary implementation.
A 404 error occurs. This is because a stale capability is captured by the Demo app. However, the UX I observe is an error message: That said, the hang you experienced is real. It's worthy of a separate issue if we can reproduce it. A few questions...
It may be worth merging these changes as unrelated to the hang. WDYT? |
Unfortunately, I couldn't reproduce the problem, and I was running the iOS simulator by itself rather than in Xcode. I could not reproduce the problem on Android, either.
It was a site previously added to the demo app that I then disabled the Gutenberg plugin. In trying to reproduce this I re-enabled the plugin, ran the demo app with that site, then again disabled the plugin. No problems occurred 🤷
Yes.
Claude agrees with you so I'll approve this :) |

What?
Copies
default-editor-styles.scssout of@wordpress/block-editorand intosrc/utils/, and imports it locally ineditor-settings.js.Fixes #590. Fixes CMM-2330.
Why?
Gutenberg #81793 removed the stylesheet from the package. It still ships in our pinned
@wordpress/block-editor@15.14.0, so nothing is broken today — but the next bump that includes the removal breaks the build, and our usage shouldn't hold up the upstream cleanup.The styles matter for us:
getDefaultEditorSettings()suppliesdefaultEditorStyleswhen a site can't provide its own editor settings, a supported path in the mobile apps.How?
The vendored copy is byte-identical to the upstream file at
28c348a(the commit before removal), with a header comment pointing back at the source, the removal PR, and core's equivalent inwp-includes/block-editor.php. Same approach asdefault-theme-styles.scssandwp-common-styles.scss.Testing Instructions
Regression check; no user-facing change expected.
trunk.🤖 Generated with Claude Code
https://claude.ai/code/session_01YZ5JzgG1CKQwmSN2P3B4R6