Add submit button styles support to block styles renderer
[MAILPOET-2604]
This commit is contained in:
committed by
Veljko V
parent
2c69d07109
commit
94784cfd8a
@@ -3,7 +3,7 @@
|
||||
namespace MailPoet\Form;
|
||||
|
||||
class BlockStylesRenderer {
|
||||
public function render(array $styles): string {
|
||||
public function renderForTextInput(array $styles): string {
|
||||
$rules = [];
|
||||
if (isset($styles['full_width']) && intval($styles['full_width'])) {
|
||||
$rules[] = 'width:100%;';
|
||||
@@ -25,4 +25,18 @@ class BlockStylesRenderer {
|
||||
}
|
||||
return implode('', $rules);
|
||||
}
|
||||
|
||||
public function renderForButton(array $styles): string {
|
||||
$rules = [];
|
||||
if (isset($styles['font_color'])) {
|
||||
$rules[] = "color:{$styles['font_color']};";
|
||||
}
|
||||
if (isset($styles['font_size'])) {
|
||||
$rules[] = "font-size:" . intval($styles['font_size']) . "px;";
|
||||
}
|
||||
if (isset($styles['bold']) && $styles['bold'] === '1') {
|
||||
$rules[] = "font-weight:bold;";
|
||||
}
|
||||
return $this->renderForTextInput($styles) . implode('', $rules);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user