<legend class="bux-text-field__legend">
    Descriptor Text
</legend>
{#

Form field descriptor
Sub-component

Variables:

- form_element:     String of the associated form element.
- descriptor.tag:   String of the descriptor HTML descriptor.tag.
                    Possible descriptor.tags:
                        - label, legend
- descriptor.text:  String of the element label.
- element_id:       String of the form element unique id.
- required:         Boolean. Determines if the form element is required.

#}

{% import 'forms/_macros/attributes.twig' as Attributes %}
{% set attributes = { class: "bux-%s__%s"|format(form_element, descriptor.tag) } %}

{% if descriptor.tag == 'label' and element_id is defined %}
    {% set attributes = attributes|merge({ for: element_id }) %}
{% endif %}

<{{ descriptor.tag }}{{ Attributes.render(attributes) }}>
    {{ descriptor.text }}
    {% if required %}
        {% include "@required" with required %}
    {% endif %}
</{{ descriptor.tag }}>
site_name_prefix: Office of
site_name: Learning Relations Excellence
site_slogan: Additional text or site slogan
address_1: 100 Building Name
address_2: 1 Oval Mall
city: Columbus
state: OH
zip: '43210'
contact_email: email@osu.edu
contact_phone: 614-292-OHIO
contact_tty: 614-688-8605
form_element: text-field
descriptor:
  tag: legend
  text: Descriptor Text

No notes defined.