Skip to content

Commit

Permalink
Fix theme.json colors custom config
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Aug 28, 2020
1 parent cc0465e commit ce8f026
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,11 @@ function gutenberg_experimental_global_styles_get_editor_features( $config ) {
}

// Deprecated theme supports.
if ( null !== get_theme_support( 'disable-custom-colors' ) ) {
if ( get_theme_support( 'disable-custom-colors' ) ) {
if ( ! isset( $config['global']['features']['colors'] ) ) {
$config['global']['features']['colors'] = array();
}
$config['global']['features']['colors']['custom'] = ! get_theme_support( 'disable-custom-colors' );
$config['global']['features']['colors']['custom'] = false;
}

return $config['global']['features'];
Expand Down Expand Up @@ -641,6 +641,8 @@ function gutenberg_experimental_global_styles_settings( $settings ) {
$settings['styles'][] = array( 'css' => $stylesheet );

$settings['__experimentalFeatures'] = gutenberg_experimental_global_styles_get_editor_features( $merged );
// Unsetting deprecated settings defined by Core.
unset( $settings[ 'disableCustomColors' ] );

return $settings;
}
Expand Down

0 comments on commit ce8f026

Please sign in to comment.