Automattic\WooCommerce\EmailEditor\Integrations\Utils

Styles_Helper::remove_css_unitpublic staticWC 1.0

Remove the CSS unit from a string.

Method of the class: Styles_Helper{}

No Hooks.

Returns

String. The string without the unit.

Usage

$result = Styles_Helper::remove_css_unit( $input ): string;
$input(string) (required)
The string to remove the unit from.

Styles_Helper::remove_css_unit() code WC 10.7.0

public static function remove_css_unit( string $input ): string {
	$units = array( 'px', 'pt', 'pc', 'rem', 'em', 'vmin', 'vmax', '%', 'vh', 'vw', 'ex', 'ch', 'fr' );
	return str_ireplace( $units, '', $input );
}