function ToolbarThemeHooks::preprocessHtml

Implements hook_preprocess_HOOK() for HTML document templates.

Attributes

#[Hook('preprocess_html')]

File

core/modules/toolbar/src/Hook/ToolbarThemeHooks.php, line 15

Class

ToolbarThemeHooks
Hook implementations for toolbar.

Namespace

Drupal\toolbar\Hook

Code

public function preprocessHtml(&$variables) : void {
  if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
    return;
  }
  $variables['attributes']['class'][] = 'toolbar-loading';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.