Automattic\WooCommerce\EmailEditor\Engine

Site_Style_Sync_Controller::convert_element_styleprivateWC 1.0

Convert individual element style to email format

Method of the class: Site_Style_Sync_Controller{}

No Hooks.

Returns

Array. Email-compatible element style.

Usage

// private - for code of main (parent) class only
$result = $this->convert_element_style( $element_style ): array;
$element_style(array) (required)
Site element style.

Site_Style_Sync_Controller::convert_element_style() code WC 10.4.3

private function convert_element_style( array $element_style ): array {
	$email_element = array();

	// Convert typography if present.
	if ( isset( $element_style['typography'] ) ) {
		$email_element['typography'] = $this->convert_typography_styles( $element_style['typography'] );
	}

	// Convert color if present.
	if ( isset( $element_style['color'] ) ) {
		$email_element['color'] = $this->convert_color_styles( $element_style['color'] );
	}

	// Convert spacing if present.
	if ( isset( $element_style['spacing'] ) ) {
		$email_element['spacing'] = $this->convert_spacing_styles( $element_style['spacing'] );
	}

	return $email_element;
}