Skip to content

Embed a local copy of the default editor styles stylesheet #590

Closed

Description

@dcalhoun

What problem does this address?

src/utils/editor-settings.js imports the default editor styles directly from the @wordpress/block-editor package:

import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline';

Gutenberg #81793 removed packages/block-editor/src/default-editor-styles.scss upstream, since the plugin hasn't enqueued it since #41306 and core owns it now. Our usage was flagged in this review comment, which also noted the removal is a breaking change for the package.

The stylesheet still ships in our pinned @wordpress/block-editor@16.0.0, so nothing is broken today. But the next package bump that includes the removal will break the build, and GutenbergKit shouldn't hold up an upstream cleanup either way.

These styles matter for us specifically: getDefaultEditorSettings() supplies defaultEditorStyles when a site can't provide its own editor settings (no experimental REST API endpoint), which is a supported path in the mobile apps.

What is your proposed solution?

Vendor the stylesheet into GutenbergKit and import it locally instead of from the package.

The repo already does this for two similar cases — src/components/visual-editor/default-theme-styles.scss and wp-common-styles.scss — both imported with ?inline in visual-editor/index.jsx. Same approach here:

  1. Add the removed SCSS as a local file (~25 lines: $default-font body type, paragraph line height, post title sizing), with a header comment pointing back at the upstream source.
  2. Update the import in src/utils/editor-settings.js to the local .scss?inline path.
  3. @wordpress/base-styles is already a dependency, so the @use of variables resolves as-is.

Worth deciding as part of this: whether to keep tracking core's version of these styles (wp-includes/block-editor.php) or treat the vendored copy as GutenbergKit's own defaults, which we'd then be free to tune for mobile.

Activity

  1. added
    [Type] Task
    on Aug 19, 2026
  2. self-assigned this
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Gutenberg[Type] Task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions