diff --git a/core/modules/comment/templates/field--comment.html.twig b/core/modules/comment/templates/field--comment.html.twig index 67dcefb..16d9009 100644 --- a/core/modules/comment/templates/field--comment.html.twig +++ b/core/modules/comment/templates/field--comment.html.twig @@ -23,16 +23,16 @@ */ #} {% - set classes = [ + attributes.addClass([ 'field', 'field-' ~ entity_type|clean_class ~ '--' ~ field_name|clean_class, 'field-name-' ~ field_name|clean_class, 'field-type-' ~ field_type|clean_class, - 'field-label-' ~ label_display|clean_class, + 'field-label-' ~ label_display, 'comment-wrapper' - ] + ]) %} - + {% if comments and not label_hidden %} {{ title_prefix }} {{ label }} diff --git a/core/modules/node/templates/field--node--title.html.twig b/core/modules/node/templates/field--node--title.html.twig index cce56d5..bb50423 100644 --- a/core/modules/node/templates/field--node--title.html.twig +++ b/core/modules/node/templates/field--node--title.html.twig @@ -16,12 +16,12 @@ */ #} {% - set classes = [ + attributes.addClass([ 'field', 'field-' ~ entity_type|clean_class ~ '--' ~ field_name|clean_class, 'field-name-' ~ field_name|clean_class, 'field-type-' ~ field_type|clean_class, - 'field-label-' ~ label_display|clean_class - ] + 'field-label-' ~ label_display + ]) %} -{{ items }} +{{ items }} diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig index eb5e2d2..26dbfc2 100644 --- a/core/modules/system/templates/field.html.twig +++ b/core/modules/system/templates/field.html.twig @@ -33,25 +33,25 @@ * @ingroup themeable */ #} -{% - set classes = [ +{%- + attributes.addClass([ 'field', 'field-' ~ entity_type|clean_class ~ '--' ~ field_name|clean_class, 'field-name-' ~ field_name|clean_class, 'field-type-' ~ field_type|clean_class, - 'field-label-' ~ label_display|clean_class, + 'field-label-' ~ label_display, label_display == 'inline' ? 'clearfix' - ] -%} -{% - set title_classes = [ + ]) +-%} +{%- + title_attributes.addClass([ 'field-label', label_display == 'visually_hidden' ? 'visually-hidden' - ] -%} - + ]) +-%} + {% if not label_hidden %} - {{ label }}:  + {{ label }}:  {% endif %} {% for delta, item in items %} diff --git a/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig b/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig index 2bbbd57..14a86a8 100644 --- a/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig +++ b/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig @@ -16,26 +16,26 @@ * @see bartik_preprocess_field() */ #} -{% - set classes = [ +{%- + attributes.addClass([ 'field', 'field-' ~ entity_type|clean_class ~ '--' ~ field_name|clean_class, 'field-name-' ~ field_name|clean_class, 'field-type-' ~ field_type|clean_class, - 'field-label-' ~ label_display|clean_class, + 'field-label-' ~ label_display, label_display == 'inline' ? 'clearfix' - ] -%} -{% - set title_classes = [ - field_type == 'taxonomy_term_reference' ? 'field-label', + ]) +-%} +{%- + title_classes.addClass([ + 'field-label', label_display == 'inline' ? 'inline', label_display == 'visually_hidden' ? 'visually-hidden' - ] -%} - + ]) +-%} + {% if not label_hidden %} - {{ label }}: + {{ label }}: {% endif %} {% for delta, item in items %}