*"; if ($justify_content === 'stretch') { $rules[$item_selector][] = "flex-grow: 1"; $rules[$list_selector][] = "justify-content: center"; } else { $rules[$list_selector][] = "justify-content: $justify_content"; } $has_height = false; foreach (array('min-height', 'height', 'max-height') as $height_property) { $settings_key = 'list_' . strtr($height_property, '-', '_'); if (!empty($settings[$settings_key])) { $value = $settings[$settings_key] . $settings[$settings_key . '_unit']; $rules[$list_selector][] = "$height_property: $value"; $has_height = true; } } // Форсированная высота 100% для элементов в контейнере: $force_height = ( ($flex_direction === 'row' && $align_items === 'stretch') || ($flex_direction === 'column' && $justify_content === 'stretch') ) && preg_match('/^\.tpl-(?:body|container)/', $selector); if ($force_height) { $rules["$item_selector > .tpl-block-list"][] = "height: 100%"; $rules["$item_selector > .tpl-block-list > *:not(.resize-sensor):not([class^='nc-']):not(.tpl-anchor)"][] = "height: 100%"; } $css = ''; foreach ($rules as $selector => $properties) { if ($properties) { $css .= "$selector {\n" . join(";\n", $properties) . ";\n}\n"; } } return $css;