- Adds new 'fontWeight' property

- Limits max button width to column width
- Adds bold option to buttons
This commit is contained in:
Vlad
2016-02-25 11:32:09 -05:00
parent f9028d28c0
commit 9e81c48bf8
2 changed files with 9 additions and 1 deletions

View File

@@ -1,10 +1,17 @@
<?php
namespace MailPoet\Newsletter\Renderer\Blocks;
use MailPoet\Newsletter\Renderer\Columns\ColumnsHelper;
use MailPoet\Newsletter\Renderer\StylesHelper;
class Button {
static function render($element) {
static function render($element, $column_count) {
$column_width = ColumnsHelper::columnWidth($column_count);
$column_width = $column_width - (StylesHelper::$padding_width * 2);
$element['styles']['block']['width'] =
((int) $element['styles']['block']['width'] > $column_width) ?
$column_width . 'px' :
$element['styles']['block']['width'];
$template = '
<tr>
<td class="mailpoet_padded" valign="top">

View File

@@ -11,6 +11,7 @@ class StylesHelper {
'textDecoration' => 'text-decoration',
'textAlign' => 'text-align',
'fontSize' => 'font-size',
'fontWeight' => 'font-weight',
'borderWidth' => 'border-width',
'borderStyle' => 'border-style',
'borderColor' => 'border-color',