diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index fefd6d5..04794b0 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -654,24 +654,8 @@ function template_preprocess_node(&$variables) {
   // Add article ARIA role.
   $variables['attributes']['role'] = 'article';
 
-  // Gather node classes.
-  $variables['attributes']['class'][] = 'node';
-  $variables['attributes']['class'][] = drupal_html_class('node--type-' . $node->bundle());
-  if ($node->isPromoted()) {
-    $variables['attributes']['class'][] = 'node--promoted';
-  }
-  if ($node->isSticky()) {
-    $variables['attributes']['class'][] = 'node--sticky';
-  }
-  if (!$node->isPublished()) {
-    $variables['attributes']['class'][] = 'node--unpublished';
-  }
-  if ($variables['view_mode']) {
-    $variables['attributes']['class'][] = drupal_html_class('node--view-mode-' . $variables['view_mode']);
-  }
-  if (isset($variables['preview'])) {
-    $variables['attributes']['class'][] = 'node--preview';
-  }
+  // Add an empty class for modules
+  $variables['attributes']['class'] = array();
 }
 
 /**
diff --git a/core/modules/node/templates/node.html.twig b/core/modules/node/templates/node.html.twig
index c80eecb..feead8a 100644
--- a/core/modules/node/templates/node.html.twig
+++ b/core/modules/node/templates/node.html.twig
@@ -77,7 +77,20 @@
  * @ingroup themeable
  */
 #}
-<article{{ attributes }}>
+
+{%
+  set add_classes = [
+    'node',
+    'node--type-' ~ node.bundle|clean_class,
+    node.promoted ? 'node--promoted',
+    node.sticky ? 'node--sticky',
+    not node.published ? 'node--unpublished',
+    'node--view-mode-' ~ view_mode|clean_class,
+    preview ? ' node--preview'
+  ]
+%}
+
+<article{{ attributes.addClass(add_classes) }}>
 
   {{ title_prefix }}
   {% if not page %}
diff --git a/core/themes/bartik/templates/node.html.twig b/core/themes/bartik/templates/node.html.twig
index d45b0f0..29a9e9f 100644
--- a/core/themes/bartik/templates/node.html.twig
+++ b/core/themes/bartik/templates/node.html.twig
@@ -71,7 +71,20 @@
  * @see template_preprocess_node()
  */
 #}
-<article class="{{ attributes.class }} clearfix"{{ attributes|without('class') }}>
+{%
+  set add_classes = [
+    'node',
+    'node--type-' ~ node.bundle|clean_class,
+    node.promoted ? 'node--promoted',
+    node.sticky ? 'node--sticky',
+    not node.published ? 'node--unpublished',
+    'node--view-mode-' ~ view_mode|clean_class,
+    preview ? ' node--preview',
+    'clearfix'
+  ]
+%}
+
+<article{{ attributes.addClass(add_classes) }}>
 
   <header>
     {{ title_prefix }}
