Skip to content

Conversation

@dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Sep 12, 2025

What?

Allow customizing block text and background color, even when the site does not
provide editor settings (lacks the experimental Gutenberg REST API endpoint) or
the theme lacks a custom color palette.

Why?

Align the experience with the web and Gutenberg Mobile editors.

Fix CMM-187. Fix #75.

Relates to wordpress-mobile/WordPress-Android#22206.

How?

  • Set default colors and gradients for sites without settings
  • Include preset editor styles
  • Update useEditorStyles copy with latest from Gutenberg core
  • Include a copy of WordPress color utility classes typically injected by server
    PHP

Testing Instructions

Tip

Use the prototype build for testing: wordpress-mobile/WordPress-Android#22206.

1: Sites without the Gutenberg plugin can customize block text and background color

  1. Add a self-hosted site.
  2. Ensure the site does not have the Gutenberg plugin activated.
  3. Ensure the Experimental block editor feature is enabled.
  4. Open the editor.
  5. Insert each of the following blocks and set the text and/or background colors.
    1. Paragraph
    2. Separator
    3. Buttons
  6. Verify the selected color renders in the editor.

2: Sites with the Gutenberg plugin can customize using theme colors

  1. Use a site with the Gutenberg plugin activated—e.g., WPCOM Simple or WoW (Atomic) site.
  2. Set the site's theme to Twenty Twenty-Five.
  3. Ensure the Experimental block editor feature is enabled.
  4. Open the editor.
  5. Insert each of the following blocks and set the text and/or background colors.
    1. Paragraph
    2. Separator
    3. Buttons
  6. Verify the theme's colors are available, not the default color palette.
  7. Verify the selected color renders in the editor.

Accessibility Testing Instructions

N/A, no navigation changes.

Screenshots or screencast

Before After
before after

If a site does not have the Gutenberg plugin enabled, the editor
settings endpoint is unavailable. We set a default color palette and
gradients to enable customizing block styles.
Ensures preset styles are loaded--e.g., utility classes for colors.
Bring our copy of this private utility up to date.
Embrace new abilities of this private function copy.
Include default color utility classes. This is typically added by
WordPress' admin via PHP. The manual addition is necessary for sites
without the GutenbergKit plugin, which do not provide editor settings
and theme styles.
Even if the theme style preferences is enabled, we must apply the
default styles if:

1. The theme provides no style via a block.json;
2. Or the site lacks the experimental Gutenberg REST API endpoint
   providing editor settings and styles.
@dcalhoun dcalhoun added the [Type] Bug An existing feature does not function as intended label Sep 12, 2025
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here update this copy of a private Gutenberg core function to match the latest version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These utility classes are generated by WordPress PHP, but are not present if a site does not have the Gutenberg plugin activated and therefore does not have the experimental editor settings REST API endpoint.

This copy serves as a fallback for those sites for the time being.

@dcalhoun dcalhoun marked this pull request as ready for review September 12, 2025 12:45
@dcalhoun dcalhoun requested a review from adalpari September 12, 2025 12:45
Copy link

@adalpari adalpari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! tested here

Ship it! :shipit:

@dcalhoun dcalhoun merged commit 840fae3 into trunk Sep 12, 2025
11 checks passed
@dcalhoun dcalhoun deleted the fix/block-customization-without-editor-settings branch September 12, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-hosted sites lack Separator lock color options and other settings

3 participants