function umami_preprocess_block in Drupal 8
Same name and namespace in other branches
- 9 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block()
Implements hook_preprocess_block().
File
- core/profiles/ demo_umami/ themes/ umami/ umami.theme, line 47 
- Functions to support theming in the Umami theme.
Code
function umami_preprocess_block(&$variables) {
  $variables['title_attributes']['class'][] = 'block__title';
  // Add a class indicating the custom block bundle.
  if (isset($variables['elements']['content']['#block_content'])) {
    $variables['attributes']['class'][] = Html::getClass('block-type-' . $variables['elements']['content']['#block_content']
      ->bundle());
  }
}