Skip to content

Commit

Permalink
Fix the link color support for themes without theme.json file (#30452)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 1, 2021
1 parent ede8f56 commit a58a6f5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ function gutenberg_experimental_global_styles_get_stylesheet( $tree, $type = 'al
* and enqueues the resulting stylesheet.
*/
function gutenberg_experimental_global_styles_enqueue_assets() {
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
if (
! get_theme_support( 'experimental-link-color' ) && // link color support needs the presets CSS variables regardless of the presence of theme.json file.
! WP_Theme_JSON_Resolver::theme_has_support() ) {
return;
}

Expand Down Expand Up @@ -231,7 +233,10 @@ function_exists( 'gutenberg_is_edit_site_page' ) &&

$settings['__experimentalGlobalStylesUserEntityId'] = $user_cpt_id;
$settings['__experimentalGlobalStylesBaseStyles'] = $base_styles;
} elseif ( WP_Theme_JSON_Resolver::theme_has_support() ) {
} elseif (
WP_Theme_JSON_Resolver::theme_has_support() ||
get_theme_support( 'experimental-link-color' ) // link color support needs the presets CSS variables regardless of the presence of theme.json file.
) {
// STEP 3 - ADD STYLES IF THEME HAS SUPPORT
//
// If we are in a block editor context, but not in edit-site,
Expand Down

0 comments on commit a58a6f5

Please sign in to comment.