Skip to content
Snippets Groups Projects
Commit 7e1a719d authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Separated the page width setting in: "Automatic > Fill available width" &...

Separated the page width setting in: "Automatic > Fill available width" & "Automatic > Fit content width (shrink)"
parent b4e31304
No related branches found
Tags 7.98
No related merge requests found
......@@ -178,7 +178,7 @@ function drowl_paragraphs_preprocess_paragraph(&$variables) {
$variables['layout_wrapper_attributes']->addClass('align-' . $ps['layout_align_children_horizontal']);
}
// Add automatic sizing column / cell classes
// Add automatic sizing column / cell classes > Cells shrink & grow automaticly to fit the width of the outer container
if ($ps['layout_sm_columns'] == '-1') {
$variables['layout_attributes']->addClass('auto');
}
......@@ -189,6 +189,17 @@ function drowl_paragraphs_preprocess_paragraph(&$variables) {
$variables['layout_attributes']->addClass('large-auto');
}
// Add automatic sizing column / cell classes > Cells are shrinked to the width of their contents
if ($ps['layout_sm_columns'] == '-2') {
$variables['layout_attributes']->addClass('shrink');
}
if ($ps['layout_md_columns'] == '-2') {
$variables['layout_attributes']->addClass('shrink');
}
if ($ps['layout_lg_columns'] == '-2') {
$variables['layout_attributes']->addClass('shrink');
}
if (!empty($ps['style_boxstyle'])) {
$variables['attributes']->addClass('box-style box-style--' . $ps['style_boxstyle']);
}
......
......@@ -83,7 +83,9 @@ class DrowlParagraphsSettingsDefaultWidget extends WidgetBase {
'12' => '12',
];
$cols_options_auto = [
'-1' => $this->t('Automatic')
'-1' => $this->t('Automatic > Fill available width')
->__toString(),
'-2' => $this->t('Automatic > Fit content width (shrink)')
->__toString(),
] + $cols_options;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment