diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 12d2a23..f8d53a5 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -342,7 +342,6 @@ function template_preprocess_menu_tree(&$variables) { if (!isset($variables['attributes']['class'])) { $variables['attributes']['class'] = array(); } - $variables['attributes']['class'][] = 'menu'; $variables['tree'] = $variables['tree']['#children']; } diff --git a/core/modules/system/templates/menu-tree.html.twig b/core/modules/system/templates/menu-tree.html.twig index 03acca6..6eba929 100644 --- a/core/modules/system/templates/menu-tree.html.twig +++ b/core/modules/system/templates/menu-tree.html.twig @@ -34,7 +34,7 @@ {{ heading.text }} {%- endif -%} {%- endif -%} - + {{ tree }} {%- endif %} diff --git a/core/themes/bartik/templates/menu-tree.html.twig b/core/themes/bartik/templates/menu-tree.html.twig new file mode 100644 index 0000000..1f9a7f3 --- /dev/null +++ b/core/themes/bartik/templates/menu-tree.html.twig @@ -0,0 +1,40 @@ +{# +/** + * @file + * Default theme implementation for a menu tree. + * + * Available variables: + * - attributes: Attributes for the UL containing the tree of links. + * - tree: Menu tree to be output. + * - heading: (optional) A heading to precede the links. + * - text: The heading text. + * - level: The heading level (e.g. 'h2', 'h3'). + * - attributes: (optional) A keyed list of attributes for the heading. + * If the heading is a string, it will be used as the text of the heading and + * the level will default to 'h2'. + * + * Headings should be used on navigation menus and any list of links that + * consistently appears on multiple pages. To make the heading invisible use + * the 'visually-hidden' CSS class. Do not use 'display:none', which + * removes it from screen-readers and assistive technology. Headings allow + * screen-reader and keyboard only users to navigate to or skip the links. + * See http://juicystudio.com/article/screen-readers-display-none.php and + * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. + * + * @see template_preprocess_menu_tree() + * + * @ingroup themeable + */ +#} +{% if tree -%} + {%- if heading -%} + {%- if heading.level -%} + <{{ heading.level }}{{ heading.attributes }}>{{ heading.text }} + {%- else -%} + {{ heading.text }} + {%- endif -%} + {%- endif -%} + + {{ tree }} + +{%- endif %}