 core/includes/theme.inc                            |  9 ++++
 .../color/tests/src/Functional/ColorTest.php       |  2 +-
 core/modules/system/src/Form/ThemeSettingsForm.php | 60 ++++++++++++++--------
 core/modules/system/src/Tests/System/ThemeTest.php | 10 ++--
 4 files changed, 54 insertions(+), 27 deletions(-)

diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 4cc6424f3e..7b6745a0e7 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -471,12 +471,18 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config)
   foreach ($theme_settings as $key => $value) {
     if ($key == 'default_logo') {
       $config->set('logo.use_default', $value);
+      if ($value == '-1') {
+        $config->clear('logo.use_default');
+      }
     }
     elseif ($key == 'logo_path') {
       $config->set('logo.path', $value);
     }
     elseif ($key == 'default_favicon') {
       $config->set('favicon.use_default', $value);
+      if ($value == '-1') {
+        $config->clear('favicon.use_default');
+      }
     }
     elseif ($key == 'favicon_path') {
       $config->set('favicon.path', $value);
@@ -486,6 +492,9 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config)
     }
     elseif (substr($key, 0, 7) == 'toggle_') {
       $config->set('features.' . Unicode::substr($key, 7), $value);
+      if ($value == '-1') {
+        $config->clear('features.' . Unicode::substr($key, 7));
+      }
     }
     elseif (!in_array($key, ['theme', 'logo_upload'])) {
       $config->set($key, $value);
diff --git a/core/modules/color/tests/src/Functional/ColorTest.php b/core/modules/color/tests/src/Functional/ColorTest.php
index c11a92262e..4938170f44 100644
--- a/core/modules/color/tests/src/Functional/ColorTest.php
+++ b/core/modules/color/tests/src/Functional/ColorTest.php
@@ -179,7 +179,7 @@ public function testValidColor() {
   public function testLogoSettingOverride() {
     $this->drupalLogin($this->bigUser);
     $edit = [
-      'default_logo' => FALSE,
+      'default_logo' => 0,
       'logo_path' => 'core/misc/druplicon.png',
     ];
     $this->drupalPostForm('admin/appearance/settings', $edit, t('Save configuration'));
diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php
index 2ad98931a3..eb61266c3d 100644
--- a/core/modules/system/src/Form/ThemeSettingsForm.php
+++ b/core/modules/system/src/Form/ThemeSettingsForm.php
@@ -113,7 +113,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme =
 
     $themes = $this->themeHandler->listInfo();
 
-    // Default settings are defined in theme_get_setting() in includes/theme.inc
     if ($theme) {
       if (!$this->themeHandler->hasUi($theme)) {
         throw new NotFoundHttpException();
@@ -127,10 +126,8 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme =
       $var = 'theme_settings';
       $config_key = 'system.theme.global';
     }
-    // @todo this is pretty meaningless since we're using theme_get_settings
-    //   which means overrides can bleed into active config here. Will be fixed
-    //   by https://www.drupal.org/node/2402467.
     $this->editableConfig = [$config_key];
+    $theme_config = $this->config($config_key);
 
     $form['var'] = [
       '#type' => 'hidden',
@@ -160,6 +157,17 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme =
       $disabled['toggle_comment_user_verification'] = TRUE;
     }
 
+    // Radio values
+    $options = [
+      1 => $this->t('Yes'),
+      0 => $this->t('No'),
+      -1 => $this->t('Inherit Global'),
+    ];
+    // Disable the 'global' option on the global settings page.
+    if (!$theme) {
+      unset($options[-1]);
+    }
+
     $form['theme_settings'] = [
       '#type' => 'details',
       '#title' => t('Page element display'),
@@ -167,7 +175,13 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme =
     ];
     foreach ($toggles as $name => $title) {
       if ((!$theme) || in_array($name, $features)) {
-        $form['theme_settings']['toggle_' . $name] = ['#type' => 'checkbox', '#title' => $title, '#default_value' => theme_get_setting('features.' . $name, $theme)];
+        $form['theme_settings']['toggle_' . $name] = [
+          '#type' => 'radios',
+          '#title' => $title,
+          '#options' => $options,
+          '#default_value' => $theme_config->get('features.' . $name) !== NULL ? (int) $theme_config->get('features.' . $name) : -1,
+          '#attributes' => ['class' => ['container-inline']],
+        ];
         // Disable checkboxes for features not supported in the current configuration.
         if (isset($disabled['toggle_' . $name])) {
           $form['theme_settings']['toggle_' . $name]['#disabled'] = TRUE;
@@ -189,24 +203,26 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme =
         '#open' => TRUE,
       ];
       $form['logo']['default_logo'] = [
-        '#type' => 'checkbox',
+        '#type' => 'radios',
         '#title' => t('Use the logo supplied by the theme'),
-        '#default_value' => theme_get_setting('logo.use_default', $theme),
+        '#options' => $options,
+        '#default_value' => $theme_config->get('logo.use_default') !== NULL ? (int) $theme_config->get('logo.use_default') : -1,
+        '#attributes' => ['class' => ['container-inline']],
         '#tree' => FALSE,
       ];
       $form['logo']['settings'] = [
         '#type' => 'container',
         '#states' => [
-          // Hide the logo settings when using the default logo.
-          'invisible' => [
-            'input[name="default_logo"]' => ['checked' => TRUE],
+          // Show the logo settings when not using the default logo.
+          'visible' => [
+            'input[name="default_logo"]' => ['value' => 0],
           ],
         ],
       ];
       $form['logo']['settings']['logo_path'] = [
         '#type' => 'textfield',
         '#title' => t('Path to custom logo'),
-        '#default_value' => theme_get_setting('logo.path', $theme),
+        '#default_value' => $theme_config->get('logo.path'),
       ];
       $form['logo']['settings']['logo_upload'] = [
         '#type' => 'file',
@@ -223,31 +239,33 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme =
         '#open' => TRUE,
         '#description' => t("Your shortcut icon, or favicon, is displayed in the address bar and bookmarks of most browsers."),
         '#states' => [
-          // Hide the shortcut icon settings fieldset when shortcut icon display
-          // is disabled.
-          'invisible' => [
-            'input[name="toggle_favicon"]' => ['checked' => FALSE],
+          // Show the shortcut icon settings fieldset when shortcut icon display
+          // is enabled.
+          'visible' => [
+            'input[name="toggle_favicon"]' => ['value' => 1],
           ],
         ],
       ];
       $form['favicon']['default_favicon'] = [
-        '#type' => 'checkbox',
+        '#type' => 'radios',
         '#title' => t('Use the favicon supplied by the theme'),
-        '#default_value' => theme_get_setting('favicon.use_default', $theme),
+        '#options' => $options,
+        '#default_value' => $theme_config->get('favicon.use_default') !== NULL ? (int) $theme_config->get('favicon.use_default') : -1,
+        '#attributes' => ['class' => ['container-inline']],
       ];
       $form['favicon']['settings'] = [
         '#type' => 'container',
         '#states' => [
-          // Hide the favicon settings when using the default favicon.
-          'invisible' => [
-            'input[name="default_favicon"]' => ['checked' => TRUE],
+          // Show the favicon settings when not using the default favicon.
+          'visible' => [
+            'input[name="default_favicon"]' => ['value' => 0],
           ],
         ],
       ];
       $form['favicon']['settings']['favicon_path'] = [
         '#type' => 'textfield',
         '#title' => t('Path to custom icon'),
-        '#default_value' => theme_get_setting('favicon.path', $theme),
+        '#default_value' => $theme_config->get('favicon.path'),
       ];
       $form['favicon']['settings']['favicon_upload'] = [
         '#type' => 'file',
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php
index 29d88a3778..ef4895229d 100644
--- a/core/modules/system/src/Tests/System/ThemeTest.php
+++ b/core/modules/system/src/Tests/System/ThemeTest.php
@@ -85,7 +85,7 @@ public function testThemeSettings() {
     ];
     foreach ($supported_paths as $input => $expected) {
       $edit = [
-        'default_logo' => FALSE,
+        'default_logo' => 0,
         'logo_path' => $input,
       ];
       $this->drupalPostForm('admin/appearance/settings', $edit, t('Save configuration'));
@@ -157,7 +157,7 @@ public function testThemeSettings() {
     $this->drupalGet('admin/appearance/settings');
     foreach ($unsupported_paths as $path) {
       $edit = [
-        'default_logo' => FALSE,
+        'default_logo' => 0,
         'logo_path' => $path,
       ];
       $this->drupalPostForm(NULL, $edit, t('Save configuration'));
@@ -166,7 +166,7 @@ public function testThemeSettings() {
 
     // Upload a file to use for the logo.
     $edit = [
-      'default_logo' => FALSE,
+      'default_logo' => 0,
       'logo_path' => '',
       'files[logo_upload]' => drupal_realpath($file->uri),
     ];
@@ -205,9 +205,9 @@ public function testThemeSettings() {
     // Ensure default logo and favicons are not triggering custom path
     // validation errors if their custom paths are set on the form.
     $edit = [
-      'default_logo' => TRUE,
+      'default_logo' => 1,
       'logo_path' => 'public://whatever.png',
-      'default_favicon' => TRUE,
+      'default_favicon' => 1,
       'favicon_path' => 'public://whatever.ico',
     ];
     $this->drupalPostForm('admin/appearance/settings', $edit, 'Save configuration');
