{%- set class_name = [
'base-heading',
'mb-0',
"u-fw-500",
props.style in ["h1", "h2", "h3", "h4", "h5", "h6"] ? "u-" ~ props.style : "u-h2",
props.style|default("h2") in ["h1", "h2"] ? "u-color-secondary" : null,
props.decoration_after ? "--decoration-after" : null,
props.name ? props.name : null,
props.extra_class|default(true) ? props.extra_class : null,
]|join(' ')|trim -%}
{% set level = props.level in [1, 2, 3, 4, 5] ? props.level : 2 %}
{%- set attrs = [
'class="' ~ class_name ~ '"',
] -%}
{%- set attrs = attrs|join(' ')|trim -%}
<h{{level}} {{ attrs|raw }}>
{% block content %}
{% if props.title %}
{{ props.title|raw }}
{% endif %}
{% if props.decoration_after %}
<div class="base-heading__decoration-after w-100 my-auto u-bg-primary-200"></div>
{% endif %}
{% endblock %}
</h{{level}}>