Skip to content

Commit

Permalink
If css property is background append -color to css var
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies committed Apr 21, 2022
1 parent 9e9bd1d commit d06cf34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ')',
);
}

Expand Down

0 comments on commit d06cf34

Please sign in to comment.