{#
/**
 * @file
 * CivicTheme Field Description component.
 *
 * Props:
 * - theme: [string] Theme variation (light or dark).
 * - content: [string] The description's content.
 * - size: [string] Description size (large, regular).
 * - allow_html: [boolean] Whether to allow HTML in text.
 * - attributes: [string] Additional HTML attributes.
 * - modifier_class: [string] Additional CSS classes.
 */
#}

{% set size = size in ['large', 'regular'] ? size : 'regular' %}
{% set size_class = 'ct-field-description--%s'|format(size) %}
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %}
{% set modifier_class = '%s %s %s'|format(theme_class, size_class, modifier_class|default('')) %}

{% if content is not empty -%}
  <div class="ct-field-description {{ modifier_class -}}" {% if attributes is not empty %}{{- attributes|raw -}}{% endif %}>
    {% if allow_html is defined ? allow_html : false %}
      {{- content|raw -}}
    {% else %}
      {{- content -}}
    {% endif %}
  </div>
{%- endif %}
