the implementation removes all predefined attributes like "prefix,lng,ltr etc"
the function toolbar_anti_flicker preprocess_html should change from:

function toolbar_anti_flicker_preprocess_html(&$variables) {
  if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
    return;
  }
  $attributes = array();
  $attributes['class'] = 'toolbar-no-flickering';
  $variables['html_attributes']['class'] = new Attribute($attributes);
}

to:

function toolbar_anti_flicker_preprocess_html(&$variables) {
  if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
    return;
  }
  $variables['html_attributes']->addClass('toolbar-no-flickering');
}

Comments

sl45sms created an issue. See original summary.

  • droplet committed a2d03c3 on 8.x-1.x
    Issue #2707675 by sl45sms, droplet: Adding class attribute to HTML tag...
droplet’s picture

Status: Active » Fixed
Issue tags: -preprocess_html prefix lang

Fixed! Thanks!

  • droplet committed a2d03c3 on 8.x-2.x
    Issue #2707675 by sl45sms, droplet: Adding class attribute to HTML tag...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.