Skip to content

Commit

Permalink
Take info from style.border.side.color (search block)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored and aaronrobertshaw committed Apr 12, 2022
1 parent 93496c1 commit ce9ef9c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,10 @@ function apply_block_core_search_border_style( $attributes, $property, $side, &$
}

if ( 'color' === $property && $side ) {
$slug_path = array( 'style', 'border', $side, 'colorSlug' );
$named_color_value = _wp_array_get( $attributes, $slug_path, false );
$has_color_preset = strpos( $value, 'var:preset|color|' ) !== false;

if ( $has_color_preset && $named_color_value ) {
$value = sprintf( 'var(--wp--preset--color--%s)', $named_color_value );
$has_color_preset = strpos( $value, 'var:preset|color|' ) !== false;
if ( $has_color_preset ) {
$named_color_value = substr( $value, strrpos( $value, '|' ) + 1 );
$value = sprintf( 'var(--wp--preset--color--%s)', $named_color_value );
}
}

Expand Down

0 comments on commit ce9ef9c

Please sign in to comment.