From d06cf3433e8622117096ccba8fa93b4fdf7c062c Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Thu, 21 Apr 2022 12:00:36 +1200 Subject: [PATCH] If css property is background append -color to css var --- lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php b/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php index 516208f033e63e..eb1c25016344eb 100644 --- a/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php +++ b/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php @@ -780,9 +780,13 @@ protected static function compute_style_properties( $styles, $settings = array() continue; } + $user_preset_var = 'background' === $css_property + ? '--wp--user--preset--' . $css_property . '-color' + : '--wp--user--preset--' . $css_property; + $declarations[] = array( 'name' => $css_property, - 'value' => 'var(--wp--user--preset--' . $css_property . ',' . $value . ')', + 'value' => 'var(' . $user_preset_var . ',' . $value . ')', ); }