You are here

function toolbar_themes_preprocess_html in Toolbar Themes 8

Implements hook_preprocess_HOOK().

Parameters

$variables:

File

./toolbar_themes.module, line 193

Code

function toolbar_themes_preprocess_html(&$variables) {

  // Settings body classes.
  $config = \Drupal::config('toolbar_themes.settings');
  $variables['attributes']['class'][] = 'toolbar-themes';
  $variables['attributes']['class'][] = $config
    ->get('tabs') === 1 ? 'toolbar-has-tabs' : 'toolbar-no-tabs';
  $variables['attributes']['class'][] = $config
    ->get('icons') === 1 ? 'toolbar-has-icons' : 'toolbar-no-icons';

  // Admin theme class
  $admin_theme = \Drupal::config('system.theme')
    ->get('admin');
  $variables['attributes']['class'][] = 'toolbar-themes-admin-theme--' . Html::cleanCssIdentifier($admin_theme);

  // Third party module classes
  if (\Drupal::moduleHandler()
    ->moduleExists('toolbar_anti_flicker') === TRUE) {
    $variables['attributes']['class'][] = 'toolbar-anti-flicker';
  }

  //  $font_size = $config->get('font_size');
  //  if (isset($font_size)) {
  //    $padding = $font_size * 2.25;
  //
  //    $tabs = $config->get('tabs');
  //    if (isset($tabs) && $tabs === 1) {
  //      $padding = $padding * 2;
  //    }
  //    //$variables['attributes']['style'] = 'padding-top:' . $padding . 'px';
  //  }

  //kint($toolbar_config);
}