You are here

function fortytwo_admin_toolbar_preprocess_html in FortyTwo - Administration toolbar 8

Same name and namespace in other branches
  1. 2.0.x fortytwo_admin_toolbar.module \fortytwo_admin_toolbar_preprocess_html()

Implements hook_preprocess_HOOK().

File

./fortytwo_admin_toolbar.module, line 13
Fortytwo - Administration toolbar.

Code

function fortytwo_admin_toolbar_preprocess_html(&$variables) {

  // Add adminimal-admin-toolbar class to the body.
  if (_fortytwo_admin_toolbar_is_access()) {
    $variables['attributes']['class'][] = 'fortytwo-admin-toolbar';
    $config = \Drupal::service('config.factory')
      ->getEditable('config.fortytwo_admin_toolbar');
    $profile = !empty($config
      ->get('color_profile')) ? $config
      ->get('color_profile') : 'beeblebrox';
    $variables['attributes']['class'][] = 'fortytwo-admin-toolbar-' . $profile;
  }
}