<div class="flex flex-col gap-5 {% if main_element %} p-4{% else %} h-full{% endif %}">
    {% for child, span in children_and_span %}
    <div class="flex-{{ span }}">
        {{ child|safe }}
    </div>
    {% endfor %}
</div>  