diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 79f7107..1bdaf19 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2122,9 +2122,6 @@ function template_preprocess_region(&$variables) { // Create the $content variable that templates expect. $variables['content'] = $variables['elements']['#children']; $variables['region'] = $variables['elements']['#region']; - - $variables['attributes']['class'][] = 'region'; - $variables['attributes']['class'][] = drupal_html_class('region-' . $variables['region']); } /** diff --git a/core/modules/system/templates/region.html.twig b/core/modules/system/templates/region.html.twig index 9213e02..b2c5471 100644 --- a/core/modules/system/templates/region.html.twig +++ b/core/modules/system/templates/region.html.twig @@ -5,13 +5,7 @@ * * Available variables: * - content: The content for this region, typically blocks. - * - attributes: HTML attributes for the region div, including: - * - class: Classes that can be used to style contextually through CSS, - * including: - * - region: The current template type (also know as "theming hook"). - * - region-[name]: The name of the region with underscores replaced with - * dashes. For example, page_top region would have a region-page-top - * class. + * - attributes: HTML attributes for the region div. * - region: The name of the region variable as defined in the theme's * .info.yml file. * @@ -20,8 +14,14 @@ * @ingroup themeable */ #} +{% + set classes = [ + 'region', + 'region-' ~ region|clean_class, + ] +%} {% if content %} - + {{ content }} {% endif %}