-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Block customization without editor settings #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Block customization without editor settings #180
Conversation
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
adalpari
left a comment
There was a problem hiding this 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! ![]()
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?
useEditorStylescopy with latest from Gutenberg corePHP
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
2: Sites with the Gutenberg plugin can customize using theme colors
Accessibility Testing Instructions
N/A, no navigation changes.
Screenshots or screencast