stack/src/components/base-heading/base-heading.twig line 1

Open in your IDE?
  1. {%- set class_name = [
  2.   'base-heading',
  3.   'mb-0',
  4.   "u-fw-500",
  5.   props.style in ["h1", "h2", "h3", "h4", "h5", "h6"] ? "u-" ~ props.style : "u-h2",
  6.   props.style|default("h2") in ["h1", "h2"] ? "u-color-secondary" : null,
  7.   props.decoration_after ? "--decoration-after" : null,
  8.   props.name ? props.name : null,
  9.   props.extra_class|default(true) ? props.extra_class : null,
  10. ]|join(' ')|trim -%}
  11. {% set level = props.level in [1, 2, 3, 4, 5] ? props.level : 2 %}
  12. {%- set attrs = [
  13.   'class="' ~ class_name ~ '"',
  14. ] -%}
  15. {%- set attrs = attrs|join(' ')|trim -%}
  16. <h{{level}} {{ attrs|raw }}>
  17.   {% block content %}
  18.     {% if props.title %}
  19.       {{ props.title|raw }}
  20.     {% endif %}
  21.     {% if props.decoration_after %}
  22.       <div class="base-heading__decoration-after w-100 my-auto u-bg-primary-200"></div>
  23.     {% endif %}
  24.   {% endblock %}
  25. </h{{level}}>