Skip to content

Commit

Permalink
Merge pull request #16 from clickpress/feature-gapsizes
Browse files Browse the repository at this point in the history
Improve grid gap class generation and formatting logic.
  • Loading branch information
stefansl authored Nov 7, 2024
2 parents 72d41eb + 7ea5a8c commit 50bfb0c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Element/GridStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ protected function getResponse(Template $template, ContentModel $model, Request
$template->gridClasses .= ' '.$model->cp_grid_halign;
}

$template->gridClasses .= $this->generateGapClass('mobile', $model->cp_gap_mobile);
$template->gridClasses .= $this->generateGapClass('tablet', $model->cp_gap_tablet);
$template->gridClasses .= $this->generateGapClass('desktop', $model->cp_gap_desktop);
$template->gridClasses .= ($model->cp_gap_mobile) ? $this->generateGapClass('mobile', $model->cp_gap_mobile) : '';
$template->gridClasses .= ($model->cp_gap_tablet) ? $this->generateGapClass('tablet', $model->cp_gap_tablet) : '';
$template->gridClasses .= ($model->cp_gap_desktop) ? $this->generateGapClass('desktop', $model->cp_gap_desktop) : '';

return $template->getResponse();
}
Expand All @@ -123,21 +123,21 @@ private function getConfigInfo(ContentModel $model): string
'%s: %s %s, ',
$GLOBALS['TL_LANG']['tl_content']['cp_grid_mobile'][0],
$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'][$model->cp_grid_mobile],
$this->formatGapOption($model->cp_gap_mobile)
isset($model->cp_gap_mobile) ? $this->formatGapOption($model->cp_gap_mobile) : ''
);

$configInfo .= \sprintf(
'%s: %s %s, ',
$GLOBALS['TL_LANG']['tl_content']['cp_grid_tablet'][0],
$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'][$model->cp_grid_tablet],
$this->formatGapOption($model->cp_gap_tablet)
isset($model->cp_gap_tablet) ? $this->formatGapOption($model->cp_gap_tablet) : ''
);

$configInfo .= \sprintf(
'%s: %s %s, ',
$GLOBALS['TL_LANG']['tl_content']['cp_grid_desktop'][0],
$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'][$model->cp_grid_desktop],
$this->formatGapOption($model->cp_gap_desktop)
isset($model->cp_gap_desktop) ? $this->formatGapOption($model->cp_gap_desktop) : ''
);

$configInfo .= '</span>';
Expand Down

0 comments on commit 50bfb0c

Please sign in to comment.