diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 15ef789..5357890 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2164,29 +2164,11 @@ function template_preprocess_field(&$variables, $hook) {
     $delta++;
   }
 
-  // Add default CSS classes. Since there can be many fields rendered on a page,
-  // save some overhead by calling strtr() directly instead of
-  // drupal_html_class().
-  $variables['entity_type_css'] = strtr($element['#entity_type'], '_', '-');
-  $variables['field_name_css'] = strtr($element['#field_name'], '_', '-');
-  $variables['field_type_css'] = strtr($element['#field_type'], '_', '-');
-  $variables['attributes']['class'] = array(
-    'field',
-    'field-' . $variables['entity_type_css'] . '--' . $variables['field_name_css'],
-    'field-name-' . $variables['field_name_css'],
-    'field-type-' . $variables['field_type_css'],
-    'field-label-' . $element['#label_display'],
-  );
-  // Add a "clearfix" class to the wrapper since we float the label and the
-  // field items in field.module.css if the label is inline.
-  if ($element['#label_display'] == 'inline') {
-    $variables['attributes']['class'][] = 'clearfix';
-  }
-
-  // Hide labels visually, but display them to screenreaders if applicable.
-  if ($element['#label_display'] == 'visually_hidden') {
-    $variables['title_attributes']['class'][] = 'visually-hidden';
-  }
+  // Creating variables for the template.
+  $variables['entity_type'] = $element['#entity_type'];
+  $variables['field_name'] = $element['#field_name'];
+  $variables['field_type'] = $element['#field_type'];
+  $variables['label_display'] = $element['#label_display'];
 
   static $default_attributes;
   if (!isset($default_attributes)) {
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 54bfefa..65fbefd 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -857,17 +857,12 @@ function comment_preprocess_field(&$variables) {
     $variables['comment_display_mode'] = $element[0]['#comment_display_mode'];
     $variables['comment_type'] = $element[0]['#comment_type'];
 
-    // Adjust a comment field's attributes.
-    $variables['attributes']['class'][] = 'comment-wrapper';
-    $variables['title_attributes']['class'][] = 'title';
-
     // Append additional attributes (eg. RDFa) from the first field item.
     $variables['attributes'] += $variables['item_attributes'][0]->storage();
 
     // Create separate variables for the comments and comment form.
     $variables['comments'] = $element[0]['comments'];
     $variables['comment_form'] = $element[0]['comment_form'];
-    $variables['content_attributes']['class'] = array('title', 'comment-form__title');
   }
 }
 
diff --git a/core/modules/comment/templates/field--comment.html.twig b/core/modules/comment/templates/field--comment.html.twig
index 9aae572..75c54cb 100644
--- a/core/modules/comment/templates/field--comment.html.twig
+++ b/core/modules/comment/templates/field--comment.html.twig
@@ -22,17 +22,34 @@
  * @see comment_preprocess_field()
  */
 #}
-<section{{ attributes }}>
+{%
+  set classes = [
+    '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,
+    label_display == 'inline' ? 'clearfix',
+    'comment-wrapper',
+  ]
+%}
+{%
+  set title_classes = [
+    'title',
+    label_display == 'visually_hidden' ? 'visually-hidden',
+  ]
+%}
+<section{{ attributes.addClass(classes) }}>
   {% if comments and not label_hidden %}
     {{ title_prefix }}
-    <h2{{ title_attributes }}>{{ label }}</h2>
+    <h2{{ title_attributes.addClass(title_classes) }}>{{ label }}</h2>
     {{ title_suffix }}
   {% endif %}
 
   {{ comments }}
 
   {% if comment_form %}
-    <h2{{ content_attributes }}>{{ 'Add new comment'|t }}</h2>
+    <h2{{ content_attributes.addClass('title', 'comment-form__title') }}>{{ 'Add new comment'|t }}</h2>
     {{ comment_form }}
   {% endif %}
 
diff --git a/core/modules/node/templates/field--node--title.html.twig b/core/modules/node/templates/field--node--title.html.twig
index 25432c0..4c7e434 100644
--- a/core/modules/node/templates/field--node--title.html.twig
+++ b/core/modules/node/templates/field--node--title.html.twig
@@ -15,4 +15,13 @@
  * @ingroup themeable
  */
 #}
-<span{{ attributes }}>{{ items }}</span>
+{%
+  set classes = [
+    '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,
+  ]
+%}
+<span{{ attributes.addClass(classes) }}>{{ items }}</span>
diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig
index d38b028..e4093a0 100644
--- a/core/modules/system/templates/field.html.twig
+++ b/core/modules/system/templates/field.html.twig
@@ -23,19 +23,39 @@
  * - content_attributes: HTML attributes for the content.
  * - items: List of all the field items.
  * - item_attributes: List of HTML attributes for each item.
+ * - entity_type: The entity type to which the field belongs.
+ * - field_name: The name of the field.
+ * - field_type: The type of the field.
+ * - label_display: The display of the label for the field.
  *
  * @see template_preprocess_field()
  *
  * @ingroup themeable
  */
 #}
-<div{{ attributes }}>
+{%
+  set classes = [
+    '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,
+    label_display == 'inline' ? 'clearfix',
+  ]
+%}
+{%
+  set title_classes = [
+    'field-label',
+    label_display == 'visually_hidden' ? 'visually-hidden',
+  ]
+%}
+<div{{ attributes.addClass(classes) }}>
   {% if not label_hidden %}
-    <div class="field-label{% if title_attributes.class %} {{ title_attributes.class }}{% endif %}"{{ title_attributes|without('class') }}>{{ label }}:&nbsp;</div>
+    <div{{ title_attributes.addClass(title_classes) }}>{{ label }}:&nbsp;</div>
   {% endif %}
-  <div class="field-items"{{ content_attributes }}>
+  <div{{ content_attributes.addClass('field-items') }}>
     {% for delta, item in items %}
-      <div class="field-item"{{ item_attributes[delta] }}>{{ item }}</div>
+      <div{{ item_attributes[delta].addClass('field-item') }}>{{ item }}</div>
     {% endfor %}
   </div>
 </div>
diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme
index 27f8973..38fee74 100644
--- a/core/themes/bartik/bartik.theme
+++ b/core/themes/bartik/bartik.theme
@@ -151,21 +151,6 @@ function bartik_menu_tree__shortcut_default($variables) {
 }
 
 /**
- * Implements hook_preprocess_HOOK() for field.html.twig.
- *
- * @see template_preprocess_field()
- */
-function bartik_preprocess_field(&$variables) {
-  $element = $variables['element'];
-  if ($element['#field_type'] == 'taxonomy_term_reference') {
-    $variables['title_attributes']['class'][] = 'field-label';
-    if ($variables['element']['#label_display'] == 'inline') {
-      $variables['title_attributes']['class'][] = 'inline';
-    }
-  }
-}
-
-/**
  * Helper function for handling the site name and slogan.
  */
 function _bartik_process_page(&$variables) {
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 4c579ee..84d66ee 100644
--- a/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig
+++ b/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig
@@ -16,13 +16,30 @@
  * @see bartik_preprocess_field()
  */
 #}
-<div class="{{ attributes.class }} clearfix"{{ attributes|without('class') }}>
+{%
+  set classes = [
+    '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,
+    label_display == 'inline' ? 'clearfix',
+  ]
+%}
+{%
+  set title_classes = [
+    'field-label',
+    label_display == 'inline' ? 'inline',
+    label_display == 'visually_hidden' ? 'visually-hidden',
+  ]
+%}
+<div{{ attributes.addClass(classes) }}>
   {% if not label_hidden %}
-    <h3{{ title_attributes }}>{{ label }}: </h3>
+    <h3{{ title_attributes.addClass(title_classes) }}>{{ label }}: </h3>
   {% endif %}
-  <ul class="links field-items {{ content_attributes.class }}"{{ content_attributes|without('class') }}>
+  <ul{{ content_attributes.addClass('links', 'field-items') }}>
     {% for delta, item in items %}
-      <li class="taxonomy-term-reference-{{ delta }}"{{ item_attributes[delta] }}>{{ item }}</li>
+      <li{{ item_attributes[delta].addClass('taxonomy-term-reference-' ~ delta) }}>{{ item }}</li>
     {% endfor %}
   </ul>
 </div>
