WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Utils

StyleAttributesUtils::get_line_height_class_and_style() public WC 1.0

Get class and style for line height from attributes.

{} It's a method of the class: StyleAttributesUtils{}

No Hooks.

Return

(Array. | null)

Usage

$result = StyleAttributesUtils::get_line_height_class_and_style( $attributes );
$attributes(array) (required)
Block attributes.

Code of StyleAttributesUtils::get_line_height_class_and_style() WC 6.1.0

public static function get_line_height_class_and_style( $attributes ) {

	$line_height = isset( $attributes['style']['typography']['lineHeight'] ) ? $attributes['style']['typography']['lineHeight'] : null;

	if ( ! isset( $line_height ) ) {
		return null;
	};

	$line_height_style = sprintf( 'line-height: %s;', $line_height );

	return array(
		'class' => null,
		'style' => $line_height_style,
	);
}