Introduce file for sharing CSS for content between editor and renderer
[MAILPOET-6249]
This commit is contained in:
committed by
Jan Lysý
parent
b87eb3edd3
commit
95f7049bd9
@@ -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();
|
||||
|
@@ -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;
|
||||
|
15
packages/php/email-editor/src/Engine/content-shared.css
Normal file
15
packages/php/email-editor/src/Engine/content-shared.css
Normal file
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user