From b11dcc6f46951b5247a961758f61b731525af879 Mon Sep 17 00:00:00 2001
From: "ryan.armstrong" <jenova49@gmail.com>
Date: Mon, 17 Feb 2014 14:36:52 -0800
Subject: [PATCH] Issue #2190877 by rabbit_media, ryan.armstrong: Replaced
 variable_*(), theme_*_variable() with D8 CMI and added exludes to config.

---
 README.txt                                         |   3 +-
 bootstrap.info.yml                                 |  66 +---------
 config/bootstrap.breakpoints.yml                   |   4 +
 config/bootstrap.settings.yml                      |  73 +++++++++++
 config/schema/bootstrap.schema.yml                 |   9 ++
 js/bootstrap.admin.js                              |  26 ++--
 theme/alter.inc                                    |  59 +++++----
 .../bootstrap-search-form-wrapper.func.php         |   3 +-
 theme/common.inc                                   |   3 +-
 theme/icons.inc                                    |   6 +-
 theme/registry.inc                                 |   3 +-
 theme/settings.inc                                 | 146 ++++++++++-----------
 theme/system/breadcrumb.func.php                   |   3 +-
 theme/system/breadcrumb.vars.php                   |   5 +-
 theme/system/form-element.func.php                 |   3 +-
 theme/system/html.vars.php                         |   3 +-
 theme/system/page.vars.php                         |  13 +-
 theme/system/region.vars.php                       |   3 +-
 18 files changed, 230 insertions(+), 201 deletions(-)
 create mode 100644 config/bootstrap.breakpoints.yml
 create mode 100644 config/bootstrap.settings.yml
 create mode 100644 config/schema/bootstrap.schema.yml

diff --git a/README.txt b/README.txt
index fec91ad..3c6df2a 100644
--- a/README.txt
+++ b/README.txt
@@ -1,7 +1,6 @@
 Bootstrap - A base-theme for Drupal
 
-1. Bootstrap requires a minimum jQuery version of 1.7 to function properly. You must download and enable the ![jQuery Update](http://drupal.org/project/jquery_update/) module, 7.x-2.3 version or higher. Navigate to the configuration page and ensure that the minimum version selected is 1.7.
-2. By default, this base theme enables and uses a CDN for loading the Bootstrap library. If you disable this CDN, you will need to use an alternative solution for adding the necessary CSS and JS files from the Bootstrap library. This can be in the form creating a sub-theme or using a utility module.
+By default, this base theme enables and uses a CDN for loading the Bootstrap library. If you disable this CDN, you will need to use an alternative solution for adding the necessary CSS and JS files from the Bootstrap library. This can be in the form creating a sub-theme or using a utility module.
 
 Authors: http://drupal.org/node/259843/committers
 Documentation: http://drupal.org/node/1976938
\ No newline at end of file
diff --git a/bootstrap.info.yml b/bootstrap.info.yml
index 07d09e6..1a58c02 100644
--- a/bootstrap.info.yml
+++ b/bootstrap.info.yml
@@ -1,15 +1,9 @@
-###############
-# Declaration #
-###############
-name: Bootstrap
 type: theme
+name: Bootstrap
 description: 'Built to use Bootstrap, a sleek, intuitive, and powerful front-end framework for faster and easier web development.'
 package: Bootstrap
 version: VERSION
 core: 8.x
-###########
-# Regions #
-###########
 regions:
   navigation: Navigation
   header: Top Bar
@@ -21,61 +15,3 @@ regions:
   footer: Footer
   page_top: Page top
   page_bottom: Page bottom
-##################
-# Theme Settings #
-##################
-settings:
-  bootstrap_breadcrumb: '1'
-  bootstrap_breadcrumb_home: '0'
-  bootstrap_breadcrumb_title: '1'
-# Navbar #
-  bootstrap_navbar_position: ''
-  bootstrap_navbar_inverse: '0'
-# Region Wells #
-  bootstrap_region_well-navigation: ''
-  bootstrap_region_well-header: ''
-  bootstrap_region_well-highlighted: ''
-  bootstrap_region_well-help: ''
-  bootstrap_region_well-content: ''
-  bootstrap_region_well-sidebar_first: 'well'
-  bootstrap_region_well-sidebar_second: ''
-  bootstrap_region_well-footer: ''
-# Anchors #
-  bootstrap_anchors_fix: '1'
-  bootstrap_anchors_smooth_scrolling: '1'
-# Popovers #
-  bootstrap_popover_enabled: '1'
-  bootstrap_popover_animation: '1'
-  bootstrap_popover_html: '0'
-  bootstrap_popover_placement: 'right'
-  bootstrap_popover_selector: ''
-  bootstrap_popover_trigger:
-    hover: '0'
-    focus: '0'
-    click: 'click'
-  bootstrap_popover_title: ''
-  bootstrap_popover_content: ''
-  bootstrap_popover_delay: '0'
-  bootstrap_popover_container: 'body'
-# Tooltips #
-  bootstrap_tooltip_enabled: '1'
-  bootstrap_tooltip_descriptions: '1'
-  bootstrap_tooltip_animation: '1'
-  bootstrap_tooltip_html: '0'
-  bootstrap_tooltip_placement: 'auto left'
-  bootstrap_tooltip_selector: ''
-  bootstrap_tooltip_trigger:
-    hover: 'hover'
-    focus: 'focus'
-    click: '0'
-  bootstrap_tooltip_delay: '0'
-  bootstrap_tooltip_container: 'body'
-# Advanced #
-  bootstrap_cdn: '3.0.2'
-  bootstrap_bootswatch: ''
-# Global #
-  toggle_name: '1'
-  toggle_search: '1'
-#######################
-# TODO: exclude files #
-#######################
\ No newline at end of file
diff --git a/config/bootstrap.breakpoints.yml b/config/bootstrap.breakpoints.yml
new file mode 100644
index 0000000..d81b6d9
--- /dev/null
+++ b/config/bootstrap.breakpoints.yml
@@ -0,0 +1,4 @@
+mobile: '(min-width: 0px)'
+tablet: 'all and (min-width: 768px) and (max-width: 991px)'
+desktop: 'all and (min-width: 992px) and (max-width: 1199px)'
+wide: 'all and (min-width: 1200px)'
diff --git a/config/bootstrap.settings.yml b/config/bootstrap.settings.yml
new file mode 100644
index 0000000..3186f98
--- /dev/null
+++ b/config/bootstrap.settings.yml
@@ -0,0 +1,73 @@
+breadcrumb: '1'
+breadcrumb_home: '0'
+breadcrumb_title: '1'
+navbar_position: ''
+navbar_inverse: '0'
+region_well-navigation: ''
+region_well-header: ''
+region_well-highlighted: ''
+region_well-help: ''
+region_well-content: ''
+region_well-sidebar_first: 'well'
+region_well-sidebar_second: ''
+region_well-footer: ''
+anchors_fix: '1'
+anchors_smooth_scrolling: '1'
+popover_enabled: '1'
+popover_animation: '1'
+popover_html: '0'
+popover_placement: 'right'
+popover_selector: ''
+popover_trigger:
+  hover: '0'
+  focus: '0'
+  click: 'click'
+popover_title: ''
+popover_content: ''
+popover_delay: '0'
+popover_container: 'body'
+tooltip_enabled: '1'
+tooltip_descriptions: '1'
+tooltip_animation: '1'
+tooltip_html: '0'
+tooltip_placement: 'auto left'
+tooltip_selector: ''
+tooltip_trigger:
+  hover: 'hover'
+  focus: 'focus'
+  click: '0'
+tooltip_delay: '0'
+tooltip_container: 'body'
+cdn: '3.0.2'
+bootswatch: ''
+toggle_name: '1'
+toggle_search: '1'
+excludes:
+  js: 
+    - 'modules/contextual/contextual.js'
+  css:
+    - 'misc/vertical-tabs.css'
+    - 'modules/aggregator/aggregator.css'
+    - 'modules/book/book.css'
+    - 'modules/comment/comment.css'
+    - 'modules/dblog/dblog.css'
+    - 'modules/file/file.css'
+    - 'modules/filter/filter.css'
+    - 'modules/forum/forum.css'
+    - 'modules/help/help.css'
+    - 'modules/menu/menu.css'
+    - 'modules/node/node.css'
+    - 'modules/openid/openid.css'
+    - 'modules/poll/poll.css'
+    - 'modules/search/search.css'
+    - 'modules/statistics/statistics.css'
+    - 'modules/syslog/syslog.css'
+    - 'modules/system/maintenance.css'
+    - 'modules/system/system.maintenance.css'
+    - 'modules/system/system.menus.css'
+    - 'modules/system/system.messages.css'
+    - 'modules/system/system.theme.css'
+    - 'modules/taxonomy/taxonomy.css'
+    - 'modules/tracker/tracker.css'
+    - 'modules/update/update.css'
+    - 'modules/user/user.css'
diff --git a/config/schema/bootstrap.schema.yml b/config/schema/bootstrap.schema.yml
new file mode 100644
index 0000000..a3abf86
--- /dev/null
+++ b/config/schema/bootstrap.schema.yml
@@ -0,0 +1,9 @@
+# Schema for the configuration files of the Bootstrap theme.
+
+bootstrap.settings:
+  type: theme_settings_default
+  label: 'Bootstrap settings'
+
+bootstrap.breakpoints:
+  type: theme_breakpoints_default
+  label: 'Bootstrap breakpoints'
diff --git a/js/bootstrap.admin.js b/js/bootstrap.admin.js
index 492de14..91b99e8 100644
--- a/js/bootstrap.admin.js
+++ b/js/bootstrap.admin.js
@@ -14,13 +14,13 @@
       $context.find('#edit-components').drupalSetSummary(function () {
         var summary = [];
         // Breadcrumbs.
-        var breadcrumb = parseInt($context.find('select[name="bootstrap_breadcrumb"]').val(), 10);
+        var breadcrumb = parseInt($context.find('select[name="breadcrumb"]').val(), 10);
         if (breadcrumb) {
           summary.push(Drupal.t('Breadcrumbs'));
         }
         // Navbar.
-        var navbar = 'Navbar: ' + $context.find('select[name="bootstrap_navbar_position"] :selected').text();
-        if ($context.find('input[name="bootstrap_navbar_inverse"]').is(':checked')) {
+        var navbar = 'Navbar: ' + $context.find('select[name="navbar_position"] :selected').text();
+        if ($context.find('input[name="navbar_inverse"]').is(':checked')) {
           navbar += ' (' + Drupal.t('Inverse') + ')';
         }
         summary.push(navbar);
@@ -30,13 +30,13 @@
       // Javascript.
       $context.find('#edit-javascript').drupalSetSummary(function () {
         var summary = [];
-        if ($context.find('input[name="bootstrap_anchors_fix"]').is(':checked')) {
+        if ($context.find('input[name="anchors_fix"]').is(':checked')) {
           summary.push(Drupal.t('Anchors'));
         }
-        if ($context.find('input[name="bootstrap_popover_enabled"]').is(':checked')) {
+        if ($context.find('input[name="popover_enabled"]').is(':checked')) {
           summary.push(Drupal.t('Popovers'));
         }
-        if ($context.find('input[name="bootstrap_tooltip_enabled"]').is(':checked')) {
+        if ($context.find('input[name="tooltip_enabled"]').is(':checked')) {
           summary.push(Drupal.t('Tooltips'));
         }
         return summary.join(', ');
@@ -46,17 +46,17 @@
       $context.find('#edit-advanced').drupalSetSummary(function () {
         var summary = [];
         // BootstrapCDN.
-        var bootstrapCDN = $context.find('select[name="bootstrap_cdn"]').val();
+        var bootstrapCDN = $context.find('select[name="cdn"]').val();
         if (bootstrapCDN.length) {
           bootstrapCDN = 'BootstrapCDN v' + bootstrapCDN;
           // Bootswatch.
-          if ($context.find('select[name="bootstrap_bootswatch"]').val().length) {
-            bootstrapCDN += ' (' + $context.find('select[name="bootstrap_bootswatch"] :selected').text() + ')';
+          if ($context.find('select[name="bootswatch"]').val().length) {
+            bootstrapCDN += ' (' + $context.find('select[name="bootswatch"] :selected').text() + ')';
           }
           summary.push(bootstrapCDN);
         }
         // Rebuild registry.
-        if ($context.find('input[name="bootstrap_rebuild_registry"]').is(':checked')) {
+        if ($context.find('input[name="rebuild_registry"]').is(':checked')) {
           summary.push(Drupal.t('Rebuild Registry'));
         }
         return summary.join(', ');
@@ -88,7 +88,7 @@
             )
             .appendTo($preview);
           }
-          $preview.parent().find('select[name="bootstrap_bootswatch"]').bind('change', function () {
+          $preview.parent().find('select[name="bootswatch"]').bind('change', function () {
             $preview.find('.bootswatch-preview').addClass('element-invisible');
             if ($(this).val().length) {
               $preview.find('#' + $(this).val()).removeClass('element-invisible');
@@ -109,7 +109,7 @@
       $preview.once('navbar', function () {
         var $body = $context.find('body');
         var $navbar = $context.find('#navbar.navbar');
-        $preview.find('select[name="bootstrap_navbar_position"]').bind('change', function () {
+        $preview.find('select[name="navbar_position"]').bind('change', function () {
           var $position = $(this).find(':selected').val();
           $navbar.removeClass('navbar-fixed-bottom navbar-fixed-top navbar-static-top container');
           if ($position.length) {
@@ -134,7 +134,7 @@
               break;
           }
         });
-        $preview.find('input[name="bootstrap_navbar_inverse"]').bind('change', function () {
+        $preview.find('input[name="navbar_inverse"]').bind('change', function () {
           $navbar.toggleClass('navbar-inverse navbar-default');
         });
       });
diff --git a/theme/alter.inc b/theme/alter.inc
index de413b0..6c5c152 100644
--- a/theme/alter.inc
+++ b/theme/alter.inc
@@ -12,18 +12,18 @@ use Drupal\Core\Template\Attribute;
  * Implements hook_css_alter().
  */
 function bootstrap_css_alter(&$css) {
+  $config = \Drupal::config('bootstrap.settings');
   $theme_path = drupal_get_path('theme', 'bootstrap');
   // Exclude specified CSS files from theme.
-  $excludes = bootstrap_get_theme_info(NULL, 'exclude][css');
+  $excludes = $config->get('excludes.css');
   // Add Bootstrap CDN file and overrides.
-  $bootstrap_cdn = theme_get_setting('bootstrap_cdn');
-  if ($bootstrap_cdn) {
+  if ($config->get('cdn')) {
     // Add CDN.
-    if (theme_get_setting('bootstrap_bootswatch')) {
-      $cdn = '//netdna.bootstrapcdn.com/bootswatch/' . $bootstrap_cdn  . '/' . theme_get_setting('bootstrap_bootswatch') . '/bootstrap.min.css';
+    if ($config->get('bootswatch')) {
+      $cdn = '//netdna.bootstrapcdn.com/bootswatch/' . $config->get('cdn')  . '/' . $config->get('bootswatch') . '/bootstrap.min.css';
     }
     else {
-      $cdn = '//netdna.bootstrapcdn.com/bootstrap/' . $bootstrap_cdn  . '/css/bootstrap.min.css';
+      $cdn = '//netdna.bootstrapcdn.com/bootstrap/' . $config->get('cdn')  . '/css/bootstrap.min.css';
     }
     $css[$cdn] = array(
       'data' => $cdn,
@@ -152,8 +152,9 @@ function bootstrap_form_alter(array &$form, array &$form_state = array(), $form_
  * Implements hook_js_alter().
  */
 function bootstrap_js_alter(&$js) {
+  $config = \Drupal::config('bootstrap.settings');
   // Exclude specified JavaScript files from theme.
-  $excludes = bootstrap_get_theme_info(NULL, 'exclude][js');
+  $excludes = $config->get('excludes.js');
 
   $theme_path = drupal_get_path('theme', 'bootstrap');
 
@@ -205,35 +206,35 @@ function bootstrap_js_alter(&$js) {
 
   // Add Bootstrap settings.
   $js['settings']['data'][]['bootstrap'] = array(
-    'anchorsFix' => theme_get_setting('bootstrap_anchors_fix'),
-    'anchorsSmoothScrolling' => theme_get_setting('bootstrap_anchors_smooth_scrolling'),
-    'popoverEnabled' => theme_get_setting('bootstrap_popover_enabled'),
+    'anchorsFix' => $config->get('anchors_fix'),
+    'anchorsSmoothScrolling' => $config->get('anchors_smooth_scrolling'),
+    'popoverEnabled' => $config->get('popover_enabled'),
     'popoverOptions' => array(
-      'animation' => (int) theme_get_setting('bootstrap_popover_animation'),
-      'html' => (int) theme_get_setting('bootstrap_popover_html'),
-      'placement' => theme_get_setting('bootstrap_popover_placement'),
-      'selector' => theme_get_setting('bootstrap_popover_selector'),
-      'trigger' => implode(' ', array_filter(array_values((array) theme_get_setting('bootstrap_popover_trigger')))),
-      'title' => theme_get_setting('bootstrap_popover_title'),
-      'content' => theme_get_setting('bootstrap_popover_content'),
-      'delay' => (int) theme_get_setting('bootstrap_popover_delay'),
-      'container' => theme_get_setting('bootstrap_popover_container'),
+      'animation' => (int) $config->get('popover_animation'),
+      'html' => (int) $config->get('popover_html'),
+      'placement' => $config->get('popover_placement'),
+      'selector' => $config->get('popover_selector'),
+      'trigger' => implode(' ', array_filter(array_values((array) $config->get('popover_trigger')))),
+      'title' => $config->get('popover_title'),
+      'content' => $config->get('popover_content'),
+      'delay' => (int) $config->get('popover_delay'),
+      'container' => $config->get('popover_container'),
     ),
-    'tooltipEnabled' => theme_get_setting('bootstrap_tooltip_enabled'),
+    'tooltipEnabled' => $config->get('tooltip_enabled'),
     'tooltipOptions' => array(
-      'animation' => (int) theme_get_setting('bootstrap_tooltip_animation'),
-      'html' => (int) theme_get_setting('bootstrap_tooltip_html'),
-      'placement' => theme_get_setting('bootstrap_tooltip_placement'),
-      'selector' => theme_get_setting('bootstrap_tooltip_selector'),
-      'trigger' => implode(' ', array_filter(array_values((array) theme_get_setting('bootstrap_tooltip_trigger')))),
-      'delay' => (int) theme_get_setting('bootstrap_tooltip_delay'),
-      'container' => theme_get_setting('bootstrap_tooltip_container'),
+      'animation' => (int) $config->get('tooltip_animation'),
+      'html' => (int) $config->get('tooltip_html'),
+      'placement' => $config->get('tooltip_placement'),
+      'selector' => $config->get('tooltip_selector'),
+      'trigger' => implode(' ', array_filter(array_values((array) $config->get('tooltip_trigger')))),
+      'delay' => (int) $config->get('tooltip_delay'),
+      'container' => $config->get('tooltip_container'),
     ),
   );
 
   // Add CDN.
-  if (theme_get_setting('bootstrap_cdn')) {
-    $cdn = '//netdna.bootstrapcdn.com/bootstrap/' . theme_get_setting('bootstrap_cdn')  . '/js/bootstrap.min.js';
+  if ($config->get('cdn')) {
+    $cdn = '//netdna.bootstrapcdn.com/bootstrap/' . $config->get('cdn')  . '/js/bootstrap.min.js';
     $js[$cdn] = drupal_js_defaults();
     $js[$cdn]['data'] = $cdn;
     $js[$cdn]['type'] = 'external';
diff --git a/theme/bootstrap/bootstrap-search-form-wrapper.func.php b/theme/bootstrap/bootstrap-search-form-wrapper.func.php
index 4cfccf0..7566d43 100644
--- a/theme/bootstrap/bootstrap-search-form-wrapper.func.php
+++ b/theme/bootstrap/bootstrap-search-form-wrapper.func.php
@@ -8,12 +8,13 @@
  * Theme function implementation for bootstrap_search_form_wrapper.
  */
 function bootstrap_bootstrap_search_form_wrapper($variables) {
+  $config = \Drupal::config('bootstrap.settings');
   $output = '<div class="input-group">';
   $output .= $variables['element']['#children'];
   $output .= '<span class="input-group-btn">';
   $output .= '<button type="submit" class="btn btn-default">';
   // We can be sure that the font icons exist in CDN.
-  if (theme_get_setting('bootstrap_cdn')) {
+  if ($config->get('cdn')) {
     $output .= _bootstrap_icon('search');
   }
   else {
diff --git a/theme/common.inc b/theme/common.inc
index a3d8b9c..063c918 100644
--- a/theme/common.inc
+++ b/theme/common.inc
@@ -11,7 +11,8 @@ use Drupal\Core\Template\Attribute;
 /**
  * Auto-rebuild the theme registry during theme development.
  */
-if (theme_get_setting('bootstrap_rebuild_registry') && !defined('MAINTENANCE_MODE')) {
+$config = \Drupal::config('bootstrap.settings');
+if ($config->get('rebuild_registry') && !defined('MAINTENANCE_MODE')) {
   // Rebuild .info data.
   system_rebuild_theme_data();
   // Rebuild theme registry.
diff --git a/theme/icons.inc b/theme/icons.inc
index bc6136f..e0e5d97 100755
--- a/theme/icons.inc
+++ b/theme/icons.inc
@@ -21,10 +21,10 @@ function bootstrap_icon_providers() {
  * Implements hook_icon_bundles().
  */
 function bootstrap_icon_bundles() {
-  $theme = variable_get('theme_default', $GLOBALS['theme']);
-  $cdn = theme_get_setting('bootstrap_cdn', $theme);
+  $bootstrap_config = \Drupal::config('bootstrap.settings');
+  $system_config = \Drupal::config('system.theme');
   $bundles = array();
-  if ($cdn || (!$cdn && file_exists(drupal_get_path('theme', $theme) . '/bootstrap/fonts/glyphicons-halflings-regular.ttf'))) {
+  if ($bootstrap_config->get('cdn') || (!$bootstrap_config->get('cdn') && file_exists(drupal_get_path('theme', $system_config->get('default')) . '/bootstrap/fonts/glyphicons-halflings-regular.ttf'))) {
     $bundles['bootstrap'] = array(
       'render' => 'sprite',
       'provider' => 'bootstrap',
diff --git a/theme/registry.inc b/theme/registry.inc
index 091a036..dcab4aa 100644
--- a/theme/registry.inc
+++ b/theme/registry.inc
@@ -51,11 +51,12 @@ use Drupal\Component\Utility\NestedArray;
  * @see hook_theme()
  */
 function _bootstrap_theme(&$existing, $type, $theme, $path) {
+  $config = \Drupal::config('bootstrap.settings');
   // If we are auto-rebuilding the theme registry, warn about the feature.
   if (
     // Only display for site config admins.
     isset($GLOBALS['user']) && function_exists('user_access') && user_access('administer site configuration')
-    && theme_get_setting('bootstrap_rebuild_registry')
+    && $config->get('rebuild_registry')
     // Always display in the admin section, otherwise limit to three per hour.
     && (arg(0) == 'admin' || flood_is_allowed($GLOBALS['theme'] . '_rebuild_registry_warning', 3))
   ) {
diff --git a/theme/settings.inc b/theme/settings.inc
index 343e637..b368f43 100644
--- a/theme/settings.inc
+++ b/theme/settings.inc
@@ -13,6 +13,7 @@
  *   The form state array, passed by reference.
  */
 function _bootstrap_settings_form(&$form, $form_state) {
+  $config = \Drupal::config('bootstrap.settings');
   // Do not add Bootstrap specific settings to non-bootstrap based themes.
   $theme = !empty($form_state['build_info']['args'][0]) ? $form_state['build_info']['args'][0] : FALSE;
   // Global settings.
@@ -27,11 +28,6 @@ function _bootstrap_settings_form(&$form, $form_state) {
     }
   }
 
-  // Display a warning if jquery_update isn't enabled.
-  if ((!module_exists('jquery_update') || !version_compare(variable_get('jquery_update_jquery_version', 0), 1.7, '>=')) && !theme_get_setting('bootstrap_toggle_jquery_error')) {
-    drupal_set_message(t('jQuery Update is not enabled, Bootstrap requires a minimum jQuery version of 1.7 or higher.<br/>Please enable <a href="https://drupal.org/project/jquery_update">jQuery Update module</a> 7.x-2.3 or higher, you must manually set this in the configuration after it is installed.'), 'error');
-  }
-
   // Wrap global setting details in vertical tabs.
   $form['general'] = array(
     '#type' => 'vertical_tabs',
@@ -70,35 +66,35 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-  $form['components']['breadcrumbs']['bootstrap_breadcrumb'] = array(
+  $form['components']['breadcrumbs']['breadcrumb'] = array(
     '#type' => 'select',
     '#title' => t('Breadcrumb visibility'),
-    '#default_value' => theme_get_setting('bootstrap_breadcrumb'),
+    '#default_value' => $config->get('breadcrumb'),
     '#options' => array(
       0 => t('Hidden'),
       1 => t('Visible'),
       2 => t('Only in admin areas'),
     ),
   );
-  $form['components']['breadcrumbs']['bootstrap_breadcrumb_home'] = array(
+  $form['components']['breadcrumbs']['breadcrumb_home'] = array(
     '#type' => 'checkbox',
     '#title' => t('Show "Home" breadcrumb link'),
-    '#default_value' => theme_get_setting('bootstrap_breadcrumb_home'),
+    '#default_value' => $config->get('breadcrumb_home'),
     '#description' => t('If your site has a module dedicated to handling breadcrumbs already, ensure this setting is enabled.'),
     '#states' => array(
       'invisible' => array(
-        ':input[name="bootstrap_breadcrumb"]' => array('value' => 0),
+        ':input[name="breadcrumb"]' => array('value' => 0),
       ),
     ),
   );
-  $form['components']['breadcrumbs']['bootstrap_breadcrumb_title'] = array(
+  $form['components']['breadcrumbs']['breadcrumb_title'] = array(
     '#type' => 'checkbox',
     '#title' => t('Show current page title at end'),
-    '#default_value' => theme_get_setting('bootstrap_breadcrumb_title'),
+    '#default_value' => $config->get('breadcrumb_title'),
     '#description' => t('If your site has a module dedicated to handling breadcrumbs already, ensure this setting is disabled.'),
     '#states' => array(
       'invisible' => array(
-        ':input[name="bootstrap_breadcrumb"]' => array('value' => 0),
+        ':input[name="breadcrumb"]' => array('value' => 0),
       ),
     ),
   );
@@ -109,11 +105,11 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-  $form['components']['navbar']['bootstrap_navbar_position'] = array(
+  $form['components']['navbar']['navbar_position'] = array(
     '#type' => 'select',
     '#title' => t('Navbar Position'),
     '#description' => t('Select your Navbar position.'),
-    '#default_value' => theme_get_setting('bootstrap_navbar_position'),
+    '#default_value' => $config->get('navbar_position'),
     '#options' => array(
       'static-top' => t('Static Top'),
       'fixed-top' => t('Fixed Top'),
@@ -121,11 +117,11 @@ function _bootstrap_settings_form(&$form, $form_state) {
     ),
     '#empty_option' => t('Normal'),
   );
-  $form['components']['navbar']['bootstrap_navbar_inverse'] = array(
+  $form['components']['navbar']['navbar_inverse'] = array(
     '#type' => 'checkbox',
     '#title' => t('Inverse navbar style'),
     '#description' => t('Select if you want the inverse navbar style.'),
-    '#default_value' => theme_get_setting('bootstrap_navbar_inverse'),
+    '#default_value' => $config->get('navbar_inverse'),
   );
 
   // Region wells.
@@ -145,14 +141,14 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsed' => TRUE,
   );
   foreach (system_region_list($theme) as $name => $title) {
-    $form['components']['region_wells']['bootstrap_region_well-' . $name] = array(
+    $form['components']['region_wells']['region_well-' . $name] = array(
       '#title' => $title,
       '#type' => 'select',
       '#attributes' => array(
         'class' => array('input-sm'),
       ),
       '#options' => $wells,
-      '#default_value' => theme_get_setting('bootstrap_region_well-' . $name),
+      '#default_value' => $config->get('region_well-' . $name),
     );
   }
 
@@ -169,20 +165,20 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-  $form['javascript']['anchors']['bootstrap_anchors_fix'] = array(
+  $form['javascript']['anchors']['anchors_fix'] = array(
     '#type' => 'checkbox',
     '#title' => t('Fix anchor positions'),
-    '#default_value' => theme_get_setting('bootstrap_anchors_fix'),
+    '#default_value' => $config->get('anchors_fix'),
     '#description' => t('Ensures anchors are correctly positioned only when there is margin or padding detected on the BODY element. This is useful when fixed navbar or administration menus are used.'),
   );
-  $form['javascript']['anchors']['bootstrap_anchors_smooth_scrolling'] = array(
+  $form['javascript']['anchors']['anchors_smooth_scrolling'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable smooth scrolling'),
-    '#default_value' => theme_get_setting('bootstrap_anchors_smooth_scrolling'),
+    '#default_value' => $config->get('anchors_smooth_scrolling'),
     '#description' => t('Animates page by scrolling to an anchor link target smoothly when clicked.'),
     '#states' => array(
       'invisible' => array(
-        ':input[name="bootstrap_anchors_fix"]' => array('checked' => FALSE),
+        ':input[name="anchors_fix"]' => array('checked' => FALSE),
       ),
     ),
   );
@@ -194,14 +190,14 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-  $form['javascript']['popovers']['bootstrap_popover_enabled'] = array(
+  $form['javascript']['popovers']['popover_enabled'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable popovers.'),
     '#description' => t('Elements that have the !code attribute set will automatically initialize the popover upon page load. !warning', array(
       '!code' => '<code>data-toggle="popover"</code>',
       '!warning' => '<strong class="error text-error">WARNING: This feature can sometimes impact performance. Disable if pages appear to "hang" after initial load.</strong>',
     )),
-    '#default_value' => theme_get_setting('bootstrap_popover_enabled'),
+    '#default_value' => $config->get('popover_enabled'),
   );
   $form['javascript']['popovers']['options'] = array(
     '#type' => 'details',
@@ -214,27 +210,27 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsed' => TRUE,
     '#states' => array(
       'visible' => array(
-        ':input[name="bootstrap_popover_enabled"]' => array('checked' => TRUE),
+        ':input[name="popover_enabled"]' => array('checked' => TRUE),
       ),
     ),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_animation'] = array(
+  $form['javascript']['popovers']['options']['popover_animation'] = array(
     '#type' => 'checkbox',
     '#title' => t('animate'),
     '#description' => t('Apply a CSS fade transition to the popover.'),
-    '#default_value' => theme_get_setting('bootstrap_popover_animation'),
+    '#default_value' => $config->get('popover_animation'),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_html'] = array(
+  $form['javascript']['popovers']['options']['popover_html'] = array(
     '#type' => 'checkbox',
     '#title' => t('HTML'),
     '#description' => t("Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks."),
-    '#default_value' => theme_get_setting('bootstrap_popover_html'),
+    '#default_value' => $config->get('popover_html'),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_placement'] = array(
+  $form['javascript']['popovers']['options']['popover_placement'] = array(
     '#type' => 'select',
     '#title' => t('placement'),
     '#description' => t('Where to position the popover. When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.'),
-    '#default_value' => theme_get_setting('bootstrap_popover_placement'),
+    '#default_value' => $config->get('popover_placement'),
     '#options' => drupal_map_assoc(array(
       'top',
       'bottom',
@@ -247,20 +243,20 @@ function _bootstrap_settings_form(&$form, $form_state) {
       'auto right',
     )),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_selector'] = array(
+  $form['javascript']['popovers']['options']['popover_selector'] = array(
     '#type' => 'textfield',
     '#title' => t('selector'),
     '#description' => t('If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See !this and !example.', array(
       '!this' => l(t('this'), 'https://github.com/twbs/bootstrap/issues/4215'),
       '!example' => l(t('an informative example'), 'http://jsfiddle.net/fScua/'),
     )),
-    '#default_value' => theme_get_setting('bootstrap_popover_selector'),
+    '#default_value' => $config->get('popover_selector'),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_trigger'] = array(
+  $form['javascript']['popovers']['options']['popover_trigger'] = array(
     '#type' => 'checkboxes',
     '#title' => t('trigger'),
     '#description' => t('How a popover is triggered.'),
-    '#default_value' => theme_get_setting('bootstrap_popover_trigger'),
+    '#default_value' => $config->get('popover_trigger'),
     '#options' => drupal_map_assoc(array(
       'click',
       'hover',
@@ -268,29 +264,29 @@ function _bootstrap_settings_form(&$form, $form_state) {
       'manual',
     )),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_title'] = array(
+  $form['javascript']['popovers']['options']['popover_title'] = array(
     '#type' => 'textfield',
     '#title' => t('title'),
     '#description' => t("Default title value if \"title\" attribute isn't present."),
-    '#default_value' => theme_get_setting('bootstrap_popover_title'),
+    '#default_value' => $config->get('popover_title'),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_content'] = array(
+  $form['javascript']['popovers']['options']['popover_content'] = array(
     '#type' => 'textfield',
     '#title' => t('content'),
     '#description' => t("Default content value if \"data-content\" attribute isn't present."),
-    '#default_value' => theme_get_setting('bootstrap_popover_content'),
+    '#default_value' => $config->get('popover_content'),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_delay'] = array(
+  $form['javascript']['popovers']['options']['popover_delay'] = array(
     '#type' => 'textfield',
     '#title' => t('delay'),
     '#description' => t('The amount of time to delay showing and hiding the popover (in milliseconds). Does not apply to manual trigger type.'),
-    '#default_value' => theme_get_setting('bootstrap_popover_delay'),
+    '#default_value' => $config->get('popover_delay'),
   );
-  $form['javascript']['popovers']['options']['bootstrap_popover_container'] = array(
+  $form['javascript']['popovers']['options']['popover_container'] = array(
     '#type' => 'textfield',
     '#title' => t('container'),
     '#description' => t('Appends the popover to a specific element. Example: "body". This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.'),
-    '#default_value' => theme_get_setting('bootstrap_popover_container'),
+    '#default_value' => $config->get('popover_container'),
   );
   // Tooltips.
   $form['javascript']['tooltips'] = array(
@@ -302,23 +298,23 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-  $form['javascript']['tooltips']['bootstrap_tooltip_enabled'] = array(
+  $form['javascript']['tooltips']['tooltip_enabled'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable tooltips'),
     '#description' => t('Elements that have the !code attribute set will automatically initialize the tooltip upon page load. !warning', array(
       '!code' => '<code>data-toggle="tooltip"</code>',
       '!warning' => '<strong class="error text-error">WARNING: This feature can sometimes impact performance. Disable if pages appear to "hang" after initial load.</strong>',
     )),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_enabled'),
+    '#default_value' => $config->get('tooltip_enabled'),
   );
-  $form['javascript']['tooltips']['bootstrap_tooltip_descriptions'] = array(
+  $form['javascript']['tooltips']['tooltip_descriptions'] = array(
     '#type' => 'checkbox',
     '#title' => t('Convert simple form descriptions'),
     '#description' => t('Form items that contain simple descriptions (no HTML and shorter than 200 characters) will be converted into tooltips. This helps reduce the sometimes unnecessary noise of form item descriptions. By treating descriptions that contain longer text or HTML as actionable descriptions, we ensure it is always visible so its usability remains intact.'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_descriptions'),
+    '#default_value' => $config->get('tooltip_descriptions'),
     '#states' => array(
       'visible' => array(
-        ':input[name="bootstrap_tooltip_enabled"]' => array('checked' => TRUE),
+        ':input[name="tooltip_enabled"]' => array('checked' => TRUE),
       ),
     ),
   );
@@ -333,27 +329,27 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsed' => TRUE,
     '#states' => array(
       'visible' => array(
-        ':input[name="bootstrap_tooltip_enabled"]' => array('checked' => TRUE),
+        ':input[name="tooltip_enabled"]' => array('checked' => TRUE),
       ),
     ),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_animation'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_animation'] = array(
     '#type' => 'checkbox',
     '#title' => t('animate'),
     '#description' => t('Apply a CSS fade transition to the tooltip.'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_animation'),
+    '#default_value' => $config->get('tooltip_animation'),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_html'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_html'] = array(
     '#type' => 'checkbox',
     '#title' => t('HTML'),
     '#description' => t("Insert HTML into the tooltip. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks."),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_html'),
+    '#default_value' => $config->get('tooltip_html'),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_placement'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_placement'] = array(
     '#type' => 'select',
     '#title' => t('placement'),
     '#description' => t('Where to position the tooltip. When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_placement'),
+    '#default_value' => $config->get('tooltip_placement'),
     '#options' => drupal_map_assoc(array(
       'top',
       'bottom',
@@ -366,17 +362,17 @@ function _bootstrap_settings_form(&$form, $form_state) {
       'auto right',
     )),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_selector'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_selector'] = array(
     '#type' => 'textfield',
     '#title' => t('selector'),
     '#description' => t('If a selector is provided, tooltip objects will be delegated to the specified targets.'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_selector'),
+    '#default_value' => $config->get('tooltip_selector'),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_trigger'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_trigger'] = array(
     '#type' => 'checkboxes',
     '#title' => t('trigger'),
     '#description' => t('How a tooltip is triggered.'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_trigger'),
+    '#default_value' => $config->get('tooltip_trigger'),
     '#options' => drupal_map_assoc(array(
       'click',
       'hover',
@@ -384,17 +380,17 @@ function _bootstrap_settings_form(&$form, $form_state) {
       'manual',
     )),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_delay'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_delay'] = array(
     '#type' => 'textfield',
     '#title' => t('delay'),
     '#description' => t('The amount of time to delay showing and hiding the tooltip (in milliseconds). Does not apply to manual trigger type.'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_delay'),
+    '#default_value' => $config->get('tooltip_delay'),
   );
-  $form['javascript']['tooltips']['options']['bootstrap_tooltip_container'] = array(
+  $form['javascript']['tooltips']['options']['tooltip_container'] = array(
     '#type' => 'textfield',
     '#title' => t('container'),
     '#description' => t('Appends the tooltip to a specific element. Example: "body"'),
-    '#default_value' => theme_get_setting('bootstrap_tooltip_container'),
+    '#default_value' => $config->get('tooltip_container'),
   );
 
   // Advanced settings.
@@ -416,7 +412,7 @@ function _bootstrap_settings_form(&$form, $form_state) {
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
-  $form['advanced']['bootstrap_cdn']['bootstrap_cdn'] = array(
+  $form['advanced']['bootstrap_cdn']['cdn'] = array(
     '#type' => 'select',
     '#title' => t('BootstrapCDN version'),
     '#options' => drupal_map_assoc(array(
@@ -424,13 +420,13 @@ function _bootstrap_settings_form(&$form, $form_state) {
       '3.0.1',
       '3.0.2',
     )),
-    '#default_value' => theme_get_setting('bootstrap_cdn'),
+    '#default_value' => $config->get('cdn'),
     '#empty_option' => t('Disabled'),
     '#empty_value' => NULL,
   );
 
   // Bootswatch.
-  $form['advanced']['bootstrap_cdn']['bootstrap_bootswatch'] = array(
+  $form['advanced']['bootstrap_cdn']['bootswatch'] = array(
     '#type' => 'select',
     '#title' => t('Bootswatch theme'),
     '#description' => t('Use !bootstrapcdn to serve a Bootswatch Theme. Choose Bootswatch theme here.', array(
@@ -438,7 +434,7 @@ function _bootstrap_settings_form(&$form, $form_state) {
         'external' => TRUE,
       )),
     )),
-    '#default_value' => theme_get_setting('bootstrap_bootswatch'),
+    '#default_value' => $config->get('bootswatch'),
     '#empty_option' => t('Disabled'),
     '#empty_value' => NULL,
     '#suffix' => '<div id="bootswatch-preview"></div>',
@@ -459,28 +455,28 @@ function _bootstrap_settings_form(&$form, $form_state) {
       foreach ($api['themes'] as $bootswatch_theme) {
         $bootswatch_themes[strtolower($bootswatch_theme['name'])] = $bootswatch_theme['name'];
       }
-      $form['advanced']['bootstrap_cdn']['bootstrap_bootswatch']['#options'] = $bootswatch_themes;
+      $form['advanced']['bootstrap_cdn']['bootswatch']['#options'] = $bootswatch_themes;
     }
   }
   catch (Guzzle\Common\Exception\GuzzleException $e) {
-    $form['advanced']['bootstrap_cdn']['bootstrap_bootswatch']['#prefix'] = '<div class="alert alert-danger messages error"><strong>' . t('ERROR') . ':</strong> ' . t('Unable to reach Bootswatch API. Please ensure the server your website is hosted on is able to initiate HTTP requests.') . '</div>';
+    $form['advanced']['bootstrap_cdn']['bootswatch']['#prefix'] = '<div class="alert alert-danger messages error"><strong>' . t('ERROR') . ':</strong> ' . t('Unable to reach Bootswatch API. Please ensure the server your website is hosted on is able to initiate HTTP requests.') . '</div>';
   }
 
   // Rebuild registry.
-  $form['advanced']['bootstrap_rebuild_registry'] = array(
+  $form['advanced']['rebuild_registry'] = array(
     '#type' => 'checkbox',
     '#title' => t('Rebuild theme registry on every page.'),
-    '#default_value' => theme_get_setting('bootstrap_rebuild_registry'),
+    '#default_value' => $config->get('rebuild_registry'),
     '#description' => t('During theme development, it can be very useful to continuously !rebuild. !warning', array(
       '!rebuild' => l(t('rebuild the theme registry'), 'http://drupal.org/node/173880#theme-registry'),
       '!warning' => '<div class="alert alert-warning messages warning"><strong>' . t('WARNING') . ':</strong> ' . t('This is a huge performance penalty and must be turned off on production websites. ') . '</div>',
     )),
   );
   // Suppress jQuery message.
-  $form['advanced']['bootstrap_toggle_jquery_error'] = array(
+  $form['advanced']['toggle_jquery_error'] = array(
     '#type' => 'checkbox',
     '#title' => t('Suppress jQuery version error message'),
-    '#default_value' => theme_get_setting('bootstrap_toggle_jquery_error'),
+    '#default_value' => $config->get('toggle_jquery_error'),
     '#description' => t('Enable this if the version of jQuery has been upgraded to 1.7+ using a method other than the !jquery_update module.', array(
       '!jquery_update' => l(t('jQuery Update'), 'https://drupal.org/project/jquery_update'),
     )),
diff --git a/theme/system/breadcrumb.func.php b/theme/system/breadcrumb.func.php
index a5305b3..70e523b 100644
--- a/theme/system/breadcrumb.func.php
+++ b/theme/system/breadcrumb.func.php
@@ -10,11 +10,12 @@
  * Print breadcrumbs as an ordered list.
  */
 function bootstrap_breadcrumb($variables) {
+  $config = \Drupal::config('bootstrap.settings');
   $output = '';
   $breadcrumb = $variables['breadcrumb'];
 
   // Determine if we are to display the breadcrumb.
-  $bootstrap_breadcrumb = theme_get_setting('bootstrap_breadcrumb');
+  $bootstrap_breadcrumb = $config->get('breadcrumb');
   if (($bootstrap_breadcrumb == 1 || ($bootstrap_breadcrumb == 2 && arg(0) == 'admin')) && !empty($breadcrumb)) {
     $output = theme('item_list', array(
       'attributes' => array(
diff --git a/theme/system/breadcrumb.vars.php b/theme/system/breadcrumb.vars.php
index 70fb9d9..647a426 100644
--- a/theme/system/breadcrumb.vars.php
+++ b/theme/system/breadcrumb.vars.php
@@ -8,15 +8,16 @@
  * Implements hook_preprocess_breadcrumb().
  */
 function bootstrap_preprocess_breadcrumb(&$variables) {
+  $config = \Drupal::config('bootstrap.settings');
   $breadcrumb = &$variables['breadcrumb'];
 
   // Optionally get rid of the homepage link.
-  $show_breadcrumb_home = theme_get_setting('bootstrap_breadcrumb_home');
+  $show_breadcrumb_home = $config->get('breadcrumb_home');
   if (!$show_breadcrumb_home) {
     array_shift($breadcrumb);
   }
 
-  if (theme_get_setting('bootstrap_breadcrumb_title') && !empty($breadcrumb)) {
+  if ($config->get('breadcrumb_title') && !empty($breadcrumb)) {
     $item = menu_get_item();
     $breadcrumb[] = array(
       // If we are on a non-default tab, use the tab's title.
diff --git a/theme/system/form-element.func.php b/theme/system/form-element.func.php
index f4cce40..8db1f20 100644
--- a/theme/system/form-element.func.php
+++ b/theme/system/form-element.func.php
@@ -10,6 +10,7 @@ use Drupal\Core\Template\Attribute;
  * Overrides theme_form_element().
  */
 function bootstrap_form_element(&$variables) {
+  $config = \Drupal::config('bootstrap.settings');
   $element = &$variables['element'];
   $is_checkbox = FALSE;
   $is_radio = FALSE;
@@ -71,7 +72,7 @@ function bootstrap_form_element(&$variables) {
   // @see bootstrap_tooltip_descriptions setting in _bootstrap_settings_form()
   if (!empty($element['#description'])) {
     $description = $element['#description'];
-    if (theme_get_setting('bootstrap_tooltip_enabled') && theme_get_setting('bootstrap_tooltip_descriptions') && $description === strip_tags($description) && strlen($description) <= 200) {
+    if ($config->get('tooltip_enabled') && $config->get('tooltip_descriptions') && $description === strip_tags($description) && strlen($description) <= 200) {
       $tooltip = TRUE;
       $attributes['data-toggle'] = 'tooltip';
       $attributes['title'] = $description;
diff --git a/theme/system/html.vars.php b/theme/system/html.vars.php
index 569aa81..3e37b68 100644
--- a/theme/system/html.vars.php
+++ b/theme/system/html.vars.php
@@ -10,7 +10,8 @@
  * Implements hook_preprocess_html().
  */
 function bootstrap_preprocess_html(&$variables) {
-  switch (theme_get_setting('bootstrap_navbar_position')) {
+  $config = \Drupal::config('bootstrap.settings');
+  switch ($config->get('navbar_position')) {
     case 'fixed-top':
       $variables['classes_array'][] = 'navbar-is-fixed-top';
       break;
diff --git a/theme/system/page.vars.php b/theme/system/page.vars.php
index 727a517..cdb4104 100644
--- a/theme/system/page.vars.php
+++ b/theme/system/page.vars.php
@@ -10,6 +10,9 @@
  * @see page.tpl.php
  */
 function bootstrap_preprocess_page(&$variables) {
+  $bootstrap_config = \Drupal::config('bootstrap.settings');
+  $menu_config = \Drupal::config('menu.settings');
+
   // Add information about the number of sidebars.
   if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) {
     $variables['content_column_class'] = ' class="col-sm-6"';
@@ -25,7 +28,7 @@ function bootstrap_preprocess_page(&$variables) {
   $variables['primary_nav'] = FALSE;
   if ($variables['main_menu']) {
     // Build links.
-    $variables['primary_nav'] = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
+    $variables['primary_nav'] = menu_tree($menu_config->get('main_links'));
     // Provide default theme wrapper function.
     $variables['primary_nav']['#theme_wrappers'] = array('menu_tree__primary');
   }
@@ -34,20 +37,20 @@ function bootstrap_preprocess_page(&$variables) {
   $variables['secondary_nav'] = FALSE;
   if ($variables['secondary_menu']) {
     // Build links.
-    $variables['secondary_nav'] = menu_tree(variable_get('menu_secondary_links_source', 'user-menu'));
+    $variables['secondary_nav'] = menu_tree($menu_config->get('secondary_links'));
     // Provide default theme wrapper function.
     $variables['secondary_nav']['#theme_wrappers'] = array('menu_tree__secondary');
   }
 
   $variables['navbar_classes_array'] = array('navbar');
 
-  if (theme_get_setting('bootstrap_navbar_position') !== '') {
-    $variables['navbar_classes_array'][] = 'navbar-' . theme_get_setting('bootstrap_navbar_position');
+  if ($bootstrap_config->get('navbar_position') !== '') {
+    $variables['navbar_classes_array'][] = 'navbar-' . $bootstrap_config->get('navbar_position');
   }
   else {
     $variables['navbar_classes_array'][] = 'container';
   }
-  if (theme_get_setting('bootstrap_navbar_inverse')) {
+  if ($bootstrap_config->get('navbar_inverse')) {
     $variables['navbar_classes_array'][] = 'navbar-inverse';
   }
   else {
diff --git a/theme/system/region.vars.php b/theme/system/region.vars.php
index 11cdeb7..3a0df78 100644
--- a/theme/system/region.vars.php
+++ b/theme/system/region.vars.php
@@ -8,11 +8,12 @@
  * Implements hook_preprocess_region().
  */
 function bootstrap_preprocess_region(&$variables) {
+  $config = \Drupal::config('bootstrap.settings');
   global $theme;
   static $wells;
   if (!isset($wells)) {
     foreach (system_region_list($theme) as $name => $title) {
-      $wells[$name] = theme_get_setting('bootstrap_region_well-' . $name);
+      $wells[$name] = $config->get('region_well-' . $name);
     }
   }
 
-- 
1.8.4

