Skip to content

Commit

Permalink
Make sure theme color palette presets are output when appearance tool…
Browse files Browse the repository at this point in the history
…s are enabled. (#57190)

* Make sure theme color palette preset styles are output.

* Check for color palette support

* Also check for border support.
  • Loading branch information
tellthemachines authored Dec 20, 2023
1 parent b080c29 commit c86c37d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ function gutenberg_get_global_stylesheet( $types = array() ) {
* @see wp_add_global_styles_for_blocks
*/
$origins = array( 'default', 'theme', 'custom' );
if ( ! $supports_theme_json ) {
/*
* If the theme doesn't have theme.json but supports both appearance tools and color palette,
* the 'theme' origin should be included so color palette presets are also output.
*/
if ( ! $supports_theme_json && ( current_theme_supports( 'appearance-tools' ) || current_theme_supports( 'border' ) ) && current_theme_supports( 'editor-color-palette' ) ) {
$origins = array( 'default', 'theme' );
} elseif ( ! $supports_theme_json ) {
$origins = array( 'default' );
}
$styles_rest = $tree->get_stylesheet( $types, $origins );
Expand Down

0 comments on commit c86c37d

Please sign in to comment.