Apply global font size for input and as a fallback also for button
[MAILPOET-2892]
This commit is contained in:
committed by
Veljko V
parent
5c604af85c
commit
749fc7a74d
@ -29,6 +29,12 @@ class BlockStylesRenderer {
|
|||||||
if (isset($formSettings['alignment'])) {
|
if (isset($formSettings['alignment'])) {
|
||||||
$rules[] = $this->convertAlignmentToMargin($formSettings['alignment']);
|
$rules[] = $this->convertAlignmentToMargin($formSettings['alignment']);
|
||||||
}
|
}
|
||||||
|
if (isset($styles['font_size'])) {
|
||||||
|
$rules[] = "font-size:" . intval($styles['font_size']) . "px;";
|
||||||
|
}
|
||||||
|
if (isset($formSettings['fontSize']) && !isset($styles['font_size'])) {
|
||||||
|
$rules[] = "font-size:" . intval($formSettings['fontSize']) . "px;";
|
||||||
|
}
|
||||||
return implode('', $rules);
|
return implode('', $rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,9 +43,6 @@ class BlockStylesRenderer {
|
|||||||
if (isset($styles['font_color'])) {
|
if (isset($styles['font_color'])) {
|
||||||
$rules[] = "color:{$styles['font_color']};";
|
$rules[] = "color:{$styles['font_color']};";
|
||||||
}
|
}
|
||||||
if (isset($styles['font_size'])) {
|
|
||||||
$rules[] = "font-size:" . intval($styles['font_size']) . "px;";
|
|
||||||
}
|
|
||||||
if (!isset($styles['border_color'])) {
|
if (!isset($styles['border_color'])) {
|
||||||
$rules[] = "border-color:transparent;";
|
$rules[] = "border-color:transparent;";
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ class BlockStylesRendererTest extends \MailPoetUnitTest {
|
|||||||
];
|
];
|
||||||
$settings = [
|
$settings = [
|
||||||
'input_padding' => '40',
|
'input_padding' => '40',
|
||||||
|
'fontSize' => 13,
|
||||||
];
|
];
|
||||||
$result = $this->renderer->renderForTextInput($styles, $settings);
|
$result = $this->renderer->renderForTextInput($styles, $settings);
|
||||||
expect($result)->contains('border-radius:10px;');
|
expect($result)->contains('border-radius:10px;');
|
||||||
@ -44,6 +45,7 @@ class BlockStylesRendererTest extends \MailPoetUnitTest {
|
|||||||
expect($result)->contains('border-width:10px;');
|
expect($result)->contains('border-width:10px;');
|
||||||
expect($result)->contains('background-color:#dddddd;');
|
expect($result)->contains('background-color:#dddddd;');
|
||||||
expect($result)->contains('padding:40px;');
|
expect($result)->contains('padding:40px;');
|
||||||
|
expect($result)->contains('font-size:13px;');
|
||||||
expect($result)->notContains('font-weight:bold;');
|
expect($result)->notContains('font-weight:bold;');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +70,7 @@ class BlockStylesRendererTest extends \MailPoetUnitTest {
|
|||||||
];
|
];
|
||||||
$settings = [
|
$settings = [
|
||||||
'input_padding' => '40',
|
'input_padding' => '40',
|
||||||
|
'fontSize' => 13,
|
||||||
];
|
];
|
||||||
$result = $this->renderer->renderForButton($styles, $settings);
|
$result = $this->renderer->renderForButton($styles, $settings);
|
||||||
expect($result)->contains('border-radius:10px;');
|
expect($result)->contains('border-radius:10px;');
|
||||||
|
Reference in New Issue
Block a user