+/**
+ * Implements hook_preprocess_HOOK() for HTML document templates.
+ */
+function toolbar_preprocess_html(&$variables) {
+ if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
+ return;
+ }
+
+ $variables['attributes'] = new Attribute($variables['attributes']);
+ $variables['attributes']->addClass(['toolbar-tray-open', 'toolbar-horizontal', 'toolbar-fixed', 'toolbar-loading']);
+}
+