diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 0549702..e8220e2 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -273,9 +273,6 @@ function template_preprocess_block(&$variables) { $variables['label'] = $variables['elements']['content']['#title']; } - $variables['attributes']['class'][] = 'block'; - $variables['attributes']['class'][] = drupal_html_class('block-' . $variables['configuration']['provider']); - // Add default class for block content. $variables['content_attributes']['class'][] = 'content'; diff --git a/core/modules/block/src/Tests/BlockViewBuilderTest.php b/core/modules/block/src/Tests/BlockViewBuilderTest.php index 58becb0..8310550 100644 --- a/core/modules/block/src/Tests/BlockViewBuilderTest.php +++ b/core/modules/block/src/Tests/BlockViewBuilderTest.php @@ -82,7 +82,7 @@ public function testBasicRendering() { $entity = entity_load('block', 'test_block1'); $output = entity_view($entity, 'block'); $expected = array(); - $expected[] = '
'; + $expected[] = '
'; $expected[] = ' '; $expected[] = ' '; $expected[] = ''; @@ -109,7 +109,7 @@ public function testBasicRendering() { $entity->save(); $output = entity_view($entity, 'block'); $expected = array(); - $expected[] = '
'; + $expected[] = '
'; $expected[] = ' '; $expected[] = '

Powered by Bananas

'; $expected[] = ' '; diff --git a/core/modules/block/templates/block.html.twig b/core/modules/block/templates/block.html.twig index 3c51d46..b628cb0 100644 --- a/core/modules/block/templates/block.html.twig +++ b/core/modules/block/templates/block.html.twig @@ -21,13 +21,6 @@ * - content: The content of this block. * - attributes: HTML attributes for the containing element. * - id: A valid HTML ID and guaranteed unique. - * - class: Classes that can be used to style contextually through - * CSS. These can be manipulated through preprocess functions. The default - * values can be one or more of the following: - * - block: The current template type, i.e., "theming hook". - * - block-[module]: The module generating the block. For example, the user - * module is responsible for handling the default user navigation block. - * In that case the class would be 'block-user'. * - title_attributes: HTML attributes for the title element. * - content_attributes: HTML attributes for the content element. * - title_prefix: Additional output populated by modules, intended to be @@ -41,7 +34,13 @@ */ @todo Remove the div around content as per http://drupal.org/node/1972122. #} - +{% + set classes = [ + 'block', + 'block-' ~ configuration.provider|clean_class, + ] +%} + {{ title_prefix }} {% if label %} {{ label }}