block_core_social_link_get_color_styles()WP 1.0

Returns CSS styles for icon and icon background colors.

No Hooks.

Return

String. Inline CSS styles for link's icon and background colors.

Usage

block_core_social_link_get_color_styles( $context );
$context(array) (required)
Block context passed to Social Link.

block_core_social_link_get_color_styles() code WP 6.4.3

function block_core_social_link_get_color_styles( $context ) {
	$styles = array();

	if ( array_key_exists( 'iconColorValue', $context ) ) {
		$styles[] = 'color: ' . $context['iconColorValue'] . '; ';
	}

	if ( array_key_exists( 'iconBackgroundColorValue', $context ) ) {
		$styles[] = 'background-color: ' . $context['iconBackgroundColorValue'] . '; ';
	}

	return implode( '', $styles );
}