{% if layout_type %}
{#
Clean up value that comes from StoriesList plugin
so that it matches the relevant library name.
(@See: /modules/custom/hab_component/src/Plugin/ParagraphHandler/StoriesList.php)
#}
{% set layout_type = layout_type|replace({' ': '-', ',': ''})|lower %}
{% endif %}
{# Dynamically attach the correct libraries. #}
{{ attach_library('h4h_theme/content-list-' ~ color_style|default('neutral')) }}
{{ attach_library('h4h_theme/content-list-' ~ layout_type|default('3up-grid')) }}
{#
We want all classes to be prefixed with 'content-list'.
Provide a default just in case.
#}
{% set style = 'content-list--' ~ color_style|default('neutral') %}
{% set layout = 'content-list--' ~ layout_type|default('3up-grid') %}
<div class="content-list__container" data-layout-type="{{ layout_type }}" data-color-style="{{ color_style }}">
<div class="content-list {{ grid ? 'l-grid' }} {{ layout }} {{ style }} {{ paging_mode_class }}">
{{ content }}
</div>
</div>