{#
/**
 * @file
 * Template for a Bootstrap 5 Heading.
 *
 * Available variables:
 * - attributes: HTML attributes for the heading element.
 * - text: The heading text content. Required.
 * - level: HTML heading level (h1-h6). Defaults to h2.
 * - alignment: Horizontal alignment utility class (text-start, text-center, text-end).
 * - text_color: Bootstrap text color utility class.
 * - custom_class: Additional CSS classes for the heading element.
 *
 * @ingroup themeable
 */
#}

{% set classes = [
  'heading',
  'heading--' ~ level|default('h2'),
  alignment|default('text-start'),
  text_color and text_color != 'none' ? text_color : '',
  custom_class|default(''),
]|filter(v => v) %}

<{{ level|default('h2') }}{{ attributes.addClass(classes) }}>
  {{ text }}
</{{ level|default('h2') }}>
