MailPoet\EmailEditor\Engine
Theme_Controller::get_styles()
Get styles for the e-mail.
Method of the class: Theme_Controller{}
No Hooks.
Return
Array{
. spacing: array{
blockGap: string, padding: array{bottom: string, left: string, right: string, top: string}
}, color: array{
background: string
}, typography: array{
fontFamily: string
} }
Usage
$Theme_Controller = new Theme_Controller(); $Theme_Controller->get_styles(): array;
Theme_Controller::get_styles() Theme Controller::get styles code WC 9.8.1
public function get_styles(): array { $theme_styles = $this->get_theme()->get_data()['styles']; // Extract preset variables. $theme_styles = $this->recursive_extract_preset_variables( $theme_styles ); // Replace preset values. $variables = $this->get_variables_values_map(); $presets = array(); foreach ( $variables as $name => $value ) { $pattern = '/var\(' . preg_quote( $name, '/' ) . '\)/i'; $presets[ $pattern ] = $value; } /* @phpstan-ignore-next-line Return type defined above. */ return $this->recursive_replace_presets( $theme_styles, $presets ); }