Refactor BlocksWidth preprocessor to set string including units

I added pixels to calculated width for easier work with it in block rendering.
[MAILPOET-5591]
This commit is contained in:
Jan Lysý
2023-10-18 19:41:54 +02:00
committed by Jan Lysý
parent ac075c197e
commit 1250d81670
7 changed files with 60 additions and 47 deletions

View File

@@ -5,9 +5,9 @@ namespace MailPoet\EmailEditor\Engine;
class StylesController {
/**
* Width of the email in pixels.
* @var int
* @var string
*/
const EMAIL_WIDTH = 660;
const EMAIL_WIDTH = '660px';
/**
* Width of the email in pixels.
@@ -17,9 +17,9 @@ class StylesController {
/**
* Padding of the email in pixels.
* @var int
* @var string
*/
const EMAIL_PADDING = 10;
const EMAIL_PADDING = '10px';
/**
* Default styles applied to the email. These are going to be replaced by style settings.
@@ -43,7 +43,7 @@ class StylesController {
}
/**
* @return array{width: int, background: string, padding: array{bottom: int, left: int, right: int, top: int}}
* @return array{width: string, background: string, padding: array{bottom: string, left: string, right: string, top: string}}
*/
public function getEmailLayoutStyles(): array {
return [