diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 68c3c54..03a56dd 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -342,7 +342,6 @@ function template_preprocess_menu_tree(&$variables) {
   if (!isset($variables['attributes']['class'])) {
     $variables['attributes']['class'] = array();
   }
-  $variables['attributes']['class'][] = 'menu';
 
   $variables['tree'] = $variables['tree']['#children'];
 }
diff --git a/core/modules/system/templates/menu-tree.html.twig b/core/modules/system/templates/menu-tree.html.twig
index 03acca6..6eba929 100644
--- a/core/modules/system/templates/menu-tree.html.twig
+++ b/core/modules/system/templates/menu-tree.html.twig
@@ -34,7 +34,7 @@
       <h2{{ heading.attributes }}>{{ heading.text }}</h2>
     {%- endif -%}
   {%- endif -%}
-  <ul{{ attributes }}>
+  <ul{{ attributes.addClass('menu') }}>
     {{ tree }}
   </ul>
 {%- endif %}
diff --git a/core/modules/views/templates/views-view-grid.html.twig b/core/modules/views/templates/views-view-grid.html.twig
index a5a813c..46f8ddf 100644
--- a/core/modules/views/templates/views-view-grid.html.twig
+++ b/core/modules/views/templates/views-view-grid.html.twig
@@ -22,15 +22,41 @@
  * @ingroup themeable
  */
 #}
+{%
+  set classes = [
+    'views-view-grid',
+    options.alignment,
+    'cols-' ~ options.columns,
+    'clearfix',
+  ]
+%}
 {% if title %}
   <h3>{{ title }}</h3>
 {% endif %}
-<div{{ attributes }}>
+<div{{ attributes.addClass(classes) }}>
 {% if options.alignment == 'horizontal' %}
   {% for row in items %}
-  <div{{ row.attributes }}>
+  {% if options.row_class_default %}
+    {%
+      set row_classes = [
+        'views-row',
+        'row-' ~ loop.index,
+        options.alignment == 'horizontal' ? 'clearfix',
+      ]
+    %}
+  {% endif %}
+  <div{{ row.attributes.addClass(row_classes) }}>
     {% for column in row.content %}
-    <div{{ column.attributes }}>
+    {% if options.col_class_default %}
+      {%
+        set col_classes = [
+          'views_col',
+          'col-' ~ loop.index,
+          options.alignment == 'horizontal' ? 'clearfix',
+        ]
+      %}
+    {% endif %}
+    <div{{ column.attributes.addClass(col_classes) }}>
       {{ column.content }}
     </div>
     {% endfor %}
@@ -38,7 +64,16 @@
   {% endfor %}
 {% else %}
   {% for column in items %}
-  <div{{ column.attributes }}>
+  {% if options.col_class_default %}
+    {%
+      set col_classes = [
+        'views_col',
+        'col-' ~ loop.index,
+        options.alignment == 'horizontal' ? 'clearfix',
+      ]
+    %}
+  {% endif %}
+  <div{{ column.attributes.addClass(col_classes) }}>
     {% for row in column.content %}
       <div{{ row.attributes }}>
         {{ row.content }}
diff --git a/core/modules/views/templates/views-view-summary-unformatted.html.twig b/core/modules/views/templates/views-view-summary-unformatted.html.twig
index 9120dd4..3557b0d 100644
--- a/core/modules/views/templates/views-view-summary-unformatted.html.twig
+++ b/core/modules/views/templates/views-view-summary-unformatted.html.twig
@@ -20,11 +20,16 @@
  */
 #}
 {% for row in rows  %}
+  {%
+    set row_classes = [
+      row.active ? 'active',
+    ]
+  %}
   {{ options.inline ? '<span' : '<div' }} class="views-summary views-summary-unformatted">
   {% if row.separator -%}
     {{ row.separator }}
   {%- endif %}
-  <a href="{{ row.url }}"{{ row.attributes }}>{{ row.link }}</a>
+  <a href="{{ row.url }}"{{ row.attributes.addClass(row_classes) }}>{{ row.link }}</a>
   {% if options.count %}
     ({{ row.count }})
   {% endif %}
diff --git a/core/modules/views/templates/views-view-summary.html.twig b/core/modules/views/templates/views-view-summary.html.twig
index 4d8ed8f..8e8d2de 100644
--- a/core/modules/views/templates/views-view-summary.html.twig
+++ b/core/modules/views/templates/views-view-summary.html.twig
@@ -22,7 +22,12 @@
 <div class="item-list">
   <ul class="views-summary">
   {% for row in rows %}
-    <li><a href="{{ row.url }}"{{ row.attributes }}>{{ row.link }}</a>
+    {%
+      set row_classes = [
+        row.active ? 'active',
+      ]
+    %}
+    <li><a href="{{ row.url }}"{{ row.attributes.addClass(row_classes) }}>{{ row.link }}</a>
       {% if options.count %}
         ({{ row.count }})
       {% endif %}
diff --git a/core/modules/views/templates/views-view-unformatted.html.twig b/core/modules/views/templates/views-view-unformatted.html.twig
index e3fb2e3..291f2e8 100644
--- a/core/modules/views/templates/views-view-unformatted.html.twig
+++ b/core/modules/views/templates/views-view-unformatted.html.twig
@@ -18,7 +18,12 @@
   <h3>{{ title }}</h3>
 {% endif %}
 {% for row in rows %}
-  <div{{ row.attributes }}>
+  {%
+    set row_classes = [
+      default_row_class ? 'views-row',
+    ]
+  %}
+  <div{{ row.attributes.addClass(row_classes) }}>
     {{ row.content }}
   </div>
 {% endfor %}
diff --git a/core/modules/views/templates/views-view.html.twig b/core/modules/views/templates/views-view.html.twig
index f839ef9..7df5878 100644
--- a/core/modules/views/templates/views-view.html.twig
+++ b/core/modules/views/templates/views-view.html.twig
@@ -37,6 +37,15 @@
  * @ingroup themeable
  */
 #}
+{%
+  set classes = [
+    'view',
+    'view-' ~ id|clean_class,
+    'view-id-' ~ id,
+    'view-display-id-' ~ display_id,
+    dom_id ? 'view-dom-id-' ~ dom_id,
+  ]
+%}
 <div{{ attributes }}>
   {{ title_prefix }}
   {% if title %}
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 7af7216..7dd8a55 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -38,10 +38,6 @@ function template_preprocess_views_view(&$variables) {
   $variables['css_class'] = '';
 
   $variables['attributes']['class'] = array();
-  $variables['attributes']['class'][] = 'view';
-  $variables['attributes']['class'][] = 'view-' . drupal_clean_css_identifier($variables['id']);
-  $variables['attributes']['class'][] = 'view-id-' . $variables['id'];
-  $variables['attributes']['class'][] = 'view-display-id-' . $variables['display_id'];
 
   $css_class = $view->display_handler->getOption('css_class');
   if (!empty($css_class)) {
@@ -103,7 +99,6 @@ function template_preprocess_views_view(&$variables) {
     // identifier for each view. This identifier is written to both
     // drupalSettings and the DIV wrapper.
     $variables['dom_id'] = $view->dom_id;
-    $variables['attributes']['class'][] = 'view-dom-id-' . $variables['dom_id'];
   }
 
   // If form fields were found in the view, reformat the view output as a form.
@@ -402,10 +397,10 @@ function template_preprocess_views_view_summary(&$variables) {
     }
     $variables['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options);
     $variables['rows'][$id]->count = intval($row->{$argument->count_alias});
+    $variables['rows'][$id]->attributes = new Attribute($variables['rows'][$id]->attributes);
     if (isset($active_urls[$variables['rows'][$id]->url])) {
-      $variables['rows'][$id]->attributes['class'][] = 'active';
+      $variables['rows'][$id]['active'] = TRUE;
     }
-    $variables['rows'][$id]->attributes = new Attribute($variables['rows'][$id]->attributes);
   }
 }
 
@@ -467,7 +462,7 @@ function template_preprocess_views_view_summary_unformatted(&$variables) {
     $variables['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options);
     $variables['rows'][$id]->count = intval($row->{$argument->count_alias});
     if (isset($active_urls[$variables['rows'][$id]->url])) {
-      $variables['rows'][$id]->attributes['class'][] = 'active';
+      $variables['rows'][$id]['active'] = TRUE;
     }
     $variables['rows'][$id]->attributes = new Attribute($variables['rows'][$id]->attributes);
   }
@@ -745,13 +740,6 @@ function template_preprocess_views_view_grid(&$variables) {
   $options = $variables['options'] = $variables['view']->style_plugin->options;
   $horizontal = ($options['alignment'] === 'horizontal');
 
-  $variables['attributes']['class'] = array(
-    'views-view-grid',
-    $options['alignment'],
-    'cols-' . $options['columns'],
-    'clearfix',
-  );
-
   $col = 0;
   $row = 0;
   $items = array();
@@ -772,14 +760,6 @@ function template_preprocess_views_view_grid(&$variables) {
     // Create attributes for rows.
     if (!$horizontal || ($horizontal && empty($items[$row]['attributes']))) {
       $row_attributes = array('class' => array());
-      // Add default views row classes.
-      if ($options['row_class_default']) {
-        $row_attributes['class'][] = 'views-row';
-        $row_attributes['class'][] = 'row-' . ($row + 1);
-        if ($horizontal) {
-          $row_attributes['class'][] = 'clearfix';
-        }
-      }
       // Add custom row classes.
       $row_class = array_filter(explode(' ', $variables['view']->style_plugin->getCustomClass($result_index, 'row')));
       if (!empty($row_class)) {
@@ -798,13 +778,6 @@ function template_preprocess_views_view_grid(&$variables) {
     if ($horizontal || (!$horizontal && empty($items[$col]['attributes']))) {
       $col_attributes = array('class' => array());
       // Add default views column classes.
-      if ($options['col_class_default']) {
-        $col_attributes['class'][] = 'views-col';
-        $col_attributes['class'][] = 'col-' . ($col + 1);
-        if (!$horizontal) {
-          $col_attributes['class'][] = 'clearfix';
-        }
-      }
       // Add custom column classes.
       $col_class = array_filter(explode(' ', $variables['view']->style_plugin->getCustomClass($result_index, 'col')));
       if (!empty($col_class)) {
@@ -870,14 +843,11 @@ function template_preprocess_views_view_unformatted(&$variables) {
   $style = $view->style_plugin;
   $options = $style->options;
 
-  $default_row_class = isset($options['default_row_class']) ? $options['default_row_class'] : FALSE;
+  $variables['default_row_class'] = isset($options['default_row_class']) ? $options['default_row_class'] : FALSE;
   foreach ($rows as $id => $row) {
     $variables['rows'][$id] = array();
     $variables['rows'][$id]['content'] = $row;
     $variables['rows'][$id]['attributes'] = array();
-    if ($default_row_class) {
-      $variables['rows'][$id]['attributes']['class'][] = 'views-row';
-    }
     if ($row_class = $view->style_plugin->getRowClass($id)) {
       $variables['rows'][$id]['attributes']['class'][] = $row_class;
     }
