Render proper content width in template previews

[MAILPOET-6249]
This commit is contained in:
Rostislav Wolny
2024-10-22 14:22:54 +02:00
committed by Jan Lysý
parent 801f586b00
commit b6d75410cf

View File

@ -41,6 +41,9 @@ class TemplatePreview {
$editorTheme->merge(new WP_Theme_JSON($templateTheme, 'custom'));
}
$additionalCSS = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'preview.css');
// Set proper content width for previews
$layoutSettings = $this->themeController->getLayoutSettings();
$additionalCSS .= ".is-root-container { width: {$layoutSettings['contentSize']}; margin: 0 auto; }";
return $editorTheme->get_stylesheet() . $additionalCSS;
}
}