{#
/**
 * @file
 * Pattern for form labels
 *
 * Available variables:
 * - attributes: A Drupal attributes object.
 * - title:  The title to be displayed in this label.
 * - required: A boolean indicating if this field is required.
 */
#}
{% set attributes = union_attributes(attributes|default([])) %}
{%
  set classes = [
    'cu-label',
    required ? 'cu-label--required',
  ]
%}
<label{{ attributes.addClass(classes) }}>{{ title }}</label>
