Open t-hamano opened 2 weeks ago
Same here. If you create a custom colour in the styles, then in a text block, the highlight option will only offer this colour without the basic palette.
I've confirmed that this issue has been occurring since at least WP 6.0.
Hii @t-hamano , I was also checking this issue recently and found this related Issue from February: https://github.com/WordPress/gutenberg/issues/59171
Here it is mentioned that we are getting the custom colors from this code:
$editor_settings['__experimentalFeatures'] = wp_get_global_settings();
// These settings may need to be updated based on data coming from theme.json sources.
if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) {
$colors_by_origin = $editor_settings['__experimentalFeatures']['color']['palette'];
$editor_settings['colors'] = isset( $colors_by_origin['custom'] ) ?
$colors_by_origin['custom'] : (
isset( $colors_by_origin['theme'] ) ?
$colors_by_origin['theme'] :
$colors_by_origin['default']
);
}
But when I was checking this in my local I modified this code to set the value of $editor_settings['colors'] as $colors_by_origin['theme'] for testing but still I was getting the custom colors only 🤔 .
Description
If the custom color palette is defined in the global styles, the color palette in the block editor package only shows that custom color palette.
Note that I'm talking about the
ColorPalette
component in the block editor package, not theColorPalette
component in the components package.This issue can be seen in color inline formatting and Cover block placeholder. From what I've tested in Playground, this problem appears to have been occurring since at least WP6.3. As I recall, all palettes - theme, default, and custom - were displayed in the past.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Cover block and text color format. Only custom colors are shown:
If no custom color is defined, the theme color is displayed:
Like color block support, it should display all three colors
default
,theme
, andcustom
:Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.