diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 01c8c5e..3c858f9 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -251,12 +251,7 @@ function system_hook_info() {
  * Implements hook_theme_suggestions_HOOK().
  */
 function system_theme_suggestions_html(array $variables) {
-  if (\Drupal::service('path.matcher')->isFrontPage()) {
-    $path_args = [''];
-  }
-  else {
-    $path_args = explode('/', ltrim(\Drupal::service('path.current')->getPath(), '/'));
-  }
+  $path_args = explode('/', trim(\Drupal::service('path.current')->getPath(), '/'));
   return theme_get_suggestions($path_args, 'html');
 }
 
@@ -264,12 +259,7 @@ function system_theme_suggestions_html(array $variables) {
  * Implements hook_theme_suggestions_HOOK().
  */
 function system_theme_suggestions_page(array $variables) {
-  if (\Drupal::service('path.matcher')->isFrontPage()) {
-    $path_args = [''];
-  }
-  else {
-    $path_args = explode('/', Url::fromRoute('<current>')->getInternalPath());
-  }
+  $path_args = explode('/', trim(\Drupal::service('path.current')->getPath(), '/'));
   return theme_get_suggestions($path_args, 'page');
 }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
index 257c61e..97559e5 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\KernelTests\Core\Theme;
 
+use Drupal\Core\Path\CurrentPathStack;
+use Drupal\Core\Path\PathMatcherInterface;
 use Drupal\Core\Theme\Registry;
 use Drupal\Core\Utility\ThemeRegistry;
 use Drupal\KernelTests\KernelTestBase;
@@ -157,4 +159,37 @@ public function testThemeRegistryAlterByTheme() {
     $this->assertEqual('value', $registry->get()['theme_test_template_test']['variables']['additional']);
   }
 
+  /**
+   * Tests front node theme suggestion generation.
+   */
+  public function testThemeSuggestions() {
+    // Mock the current page as the front page.
+    /** @var PathMatcherInterface $path_matcher */
+    $path_matcher = $this->prophesize(PathMatcherInterface::class);
+    $path_matcher->isFrontPage()->willReturn(TRUE);
+    $this->container->set('path.matcher', $path_matcher->reveal());
+    /** @var CurrentPathStack $path_matcher */
+    $path_current = $this->prophesize(CurrentPathStack::class);
+    $path_current->getPath()->willReturn('/node/1');
+    $this->container->set('path.current', $path_current->reveal());
+
+    // Check suggestions provided through hook_theme_suggestions_html().
+    $suggestions = \Drupal::moduleHandler()->invokeAll('theme_suggestions_html', [[]]);
+    $this->assertSame([
+      'html__node',
+      'html__node__%',
+      'html__node__1',
+      'html__front',
+    ], $suggestions, 'Found expected html node suggestions.');
+
+    // Check suggestions provided through hook_theme_suggestions_page().
+    $suggestions = \Drupal::moduleHandler()->invokeAll('theme_suggestions_page', [[]]);
+    $this->assertSame([
+      'page__node',
+      'page__node__%',
+      'page__node__1',
+      'page__front',
+    ], $suggestions, 'Found expected page node suggestions.');
+  }
+
 }
