diff --git a/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/ContentRenderer.php b/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/ContentRenderer.php index 3e083dfe84..04ff622b54 100644 --- a/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/ContentRenderer.php +++ b/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/ContentRenderer.php @@ -89,6 +89,7 @@ class ContentRenderer { */ private function inlineStyles($html, WP_Post $post, $template = null) { $styles = (string)file_get_contents(dirname(__FILE__) . '/' . self::CONTENT_STYLES_FILE); + $styles .= (string)file_get_contents(dirname(__FILE__) . '/../../content-shared.css'); // Apply default contentWidth to constrained blocks. $layout = $this->themeController->getLayoutSettings(); diff --git a/packages/php/email-editor/src/Engine/SettingsController.php b/packages/php/email-editor/src/Engine/SettingsController.php index c8d5652143..686862f04f 100644 --- a/packages/php/email-editor/src/Engine/SettingsController.php +++ b/packages/php/email-editor/src/Engine/SettingsController.php @@ -56,8 +56,10 @@ class SettingsController { // Assets for iframe editor (component styles, scripts, etc.) $settings['__unstableResolvedAssets'] = $this->iframeAssets; $editorContentStyles = file_get_contents(__DIR__ . '/content-editor.css'); + $sharesContentStyles = file_get_contents(__DIR__ . '/content-shared.css'); $settings['styles'] = [ ['css' => $editorContentStyles], + ['css' => $sharesContentStyles], ]; $settings['__experimentalFeatures'] = $themeSettings; diff --git a/packages/php/email-editor/src/Engine/content-shared.css b/packages/php/email-editor/src/Engine/content-shared.css new file mode 100644 index 0000000000..9c36c90c59 --- /dev/null +++ b/packages/php/email-editor/src/Engine/content-shared.css @@ -0,0 +1,15 @@ +/* + * Styles for both the email editor and renderer. + */ + +/* Automatic padding for blocks with background color */ +.email-text-block.has-background, +p.has-background, +h1.has-background, +h2.has-background, +h3.has-background, +h4.has-background, +h5.has-background, +h6.has-background { + padding: 16px 24px; +} diff --git a/packages/php/email-editor/src/Engine/shared-content.css b/packages/php/email-editor/src/Engine/shared-content.css deleted file mode 100644 index e69de29bb2..0000000000