Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer

Rendering_Context::get_layout_width_without_paddingpublicWC 1.0

Returns the width of the layout without padding.

Method of the class: Rendering_Context{}

No Hooks.

Returns

String.

Usage

$Rendering_Context = new Rendering_Context();
$Rendering_Context->get_layout_width_without_padding(): string;

Rendering_Context::get_layout_width_without_padding() code WC 10.5.0

public function get_layout_width_without_padding(): string {
	$styles          = $this->get_theme_styles();
	$layout_settings = $this->get_theme_settings()['layout'] ?? array();
	$width           = Styles_Helper::parse_value( $layout_settings['contentSize'] ?? '0px' );
	$padding         = $styles['spacing']['padding'] ?? array();
	$width          -= Styles_Helper::parse_value( $padding['left'] ?? '0px' );
	$width          -= Styles_Helper::parse_value( $padding['right'] ?? '0px' );
	return "{$width}px";
}