core/includes/menu.inc | 18 --- core/modules/block/block.module | 1 + core/modules/menu_ui/src/Tests/MenuNodeTest.php | 5 +- core/modules/menu_ui/src/Tests/MenuTest.php | 7 - .../src/Tests/Dump/Drupal6MenuSettings.php | 8 -- .../src/Tests/d6/MigrateMenuConfigsTest.php | 2 - .../Tests/Cache/PageCacheTagsIntegrationTest.php | 10 ++ core/modules/system/system.module | 17 +-- .../templates/block--system-menu-block.html.twig | 48 +++++++ core/modules/system/templates/menu-tree.html.twig | 23 +--- .../user/src/Tests/UserAccountLinksTests.php | 4 + .../user/src/Tests/UserPasswordResetTest.php | 12 ++ core/modules/views/src/Tests/Wizard/MenuTest.php | 2 + .../block.block.bartik_mainnavigation_level1.yml | 2 +- core/themes/bartik/bartik.theme | 13 +- core/themes/bartik/css/colors.css | 4 +- core/themes/bartik/css/layout.css | 8 -- core/themes/bartik/css/style.css | 144 ++++++++++----------- .../templates/block--system-menu-block.html.twig | 22 ++++ core/themes/bartik/templates/page.html.twig | 19 --- 20 files changed, 186 insertions(+), 183 deletions(-) diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 92156c3..2afdaa9 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -311,23 +311,6 @@ * Implements template_preprocess_HOOK() for theme_menu_tree(). */ function template_preprocess_menu_tree(&$variables) { - if (isset($variables['tree']['#heading'])) { - $variables['heading'] = $variables['tree']['#heading']; - $heading = &$variables['heading']; - // Convert a string heading into an array, using a H2 tag by default. - if (is_string($heading)) { - $heading = array('text' => $heading); - } - // Merge in default array properties into $heading. - $heading += array( - 'level' => 'h2', - 'attributes' => array(), - ); - // Convert the attributes array into an Attribute object. - $heading['attributes'] = new Attribute($heading['attributes']); - $heading['text'] = String::checkPlain($heading['text']); - } - if (isset($variables['tree']['#attributes'])) { $variables['attributes'] = new Attribute($variables['tree']['#attributes']); } @@ -337,7 +320,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/block/block.module b/core/modules/block/block.module index 339d163..9582874 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -267,6 +267,7 @@ function template_preprocess_block(&$variables) { $variables['base_plugin_id'] = $variables['elements']['#base_plugin_id']; $variables['derivative_plugin_id'] = $variables['elements']['#derivative_plugin_id']; $variables['label'] = !empty($variables['configuration']['label_display']) ? $variables['configuration']['label'] : ''; + $variables['label_display'] = $variables['configuration']['label_display']; $variables['content'] = $variables['elements']['content']; // A block's label is configuration: it is static. Allow dynamic labels to be // set in the render array. diff --git a/core/modules/menu_ui/src/Tests/MenuNodeTest.php b/core/modules/menu_ui/src/Tests/MenuNodeTest.php index 11a1aca..fdd0e71 100644 --- a/core/modules/menu_ui/src/Tests/MenuNodeTest.php +++ b/core/modules/menu_ui/src/Tests/MenuNodeTest.php @@ -22,10 +22,13 @@ class MenuNodeTest extends WebTestBase { * * @var array */ - public static $modules = array('menu_ui', 'test_page_test', 'node'); + public static $modules = array('menu_ui', 'test_page_test', 'node', 'block'); protected function setUp() { parent::setUp(); + + $this->drupalPlaceBlock('system_menu_block:main'); + $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); $this->admin_user = $this->drupalCreateUser(array( diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php index 09bc6f4..c35d0d1 100644 --- a/core/modules/menu_ui/src/Tests/MenuTest.php +++ b/core/modules/menu_ui/src/Tests/MenuTest.php @@ -839,13 +839,6 @@ private function verifyAccess($response = 200) { $this->assertText(t('Edit menu item'), 'Menu edit page was displayed'); } - // View menu settings page. - $this->drupalGet('admin/structure/menu/settings'); - $this->assertResponse($response); - if ($response == 200) { - $this->assertText(t('Menus'), 'Menu settings page was displayed'); - } - // View add menu page. $this->drupalGet('admin/structure/menu/add'); $this->assertResponse($response); diff --git a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6MenuSettings.php b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6MenuSettings.php index 752614a..a5ac43f 100644 --- a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6MenuSettings.php +++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6MenuSettings.php @@ -23,14 +23,6 @@ public function load() { 'value', )) ->values(array( - 'name' => 'menu_primary_links_source', - 'value' => 's:13:"primary-links";', - )) - ->values(array( - 'name' => 'menu_secondary_links_source', - 'value' => 's:15:"secondary-links";', - )) - ->values(array( 'name' => 'menu_override_parent_selector', 'value' => 'b:0;', )) diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php index aa4fd0c..cc8a89d 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php @@ -46,8 +46,6 @@ protected function setUp() { */ public function testMenuSettings() { $config = \Drupal::config('menu_ui.settings'); - $this->assertIdentical($config->get('main_links'), 'primary-links'); - $this->assertIdentical($config->get('secondary_links'), 'secondary-links'); $this->assertIdentical($config->get('override_parent_selector'), FALSE); $this->assertConfigSchema(\Drupal::service('config.typed'), 'menu_ui.settings', $config->get()); } diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php index 9c41eb8..ba0d8cc 100644 --- a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php +++ b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php @@ -77,7 +77,11 @@ function testPageCacheTags() { 'block:bartik_login', 'block:bartik_footer', 'block:bartik_powered', + 'block:bartik_mainnavigation_level1', + 'block:bartik_useraccountmenu_level1', 'block_plugin:system_main_block', + 'block_plugin:system_menu_block__account', + 'block_plugin:system_menu_block__main', 'block_plugin:system_menu_block__tools', 'block_plugin:user_login_block', 'block_plugin:system_menu_block__footer', @@ -86,6 +90,7 @@ function testPageCacheTags() { 'node:' . $node_1->id(), 'user:' . $author_1->id(), 'filter_format:basic_html', + 'menu:account', 'menu:tools', 'menu:footer', 'menu:main', @@ -103,7 +108,11 @@ function testPageCacheTags() { 'block:' . $block->id(), 'block:bartik_footer', 'block:bartik_powered', + 'block:bartik_mainnavigation_level1', + 'block:bartik_useraccountmenu_level1', 'block_plugin:system_main_block', + 'block_plugin:system_menu_block__account', + 'block_plugin:system_menu_block__main', 'block_plugin:system_menu_block__tools', 'block_plugin:user_login_block', 'block_plugin:views_block__comments_recent-block_1', @@ -113,6 +122,7 @@ function testPageCacheTags() { 'node:' . $node_2->id(), 'user:' . $author_2->id(), 'filter_format:full_html', + 'menu:account', 'menu:tools', 'menu:footer', 'menu:main', diff --git a/core/modules/system/system.module b/core/modules/system/system.module index e85acfb..6142dfc 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -154,13 +154,16 @@ function system_help($route_name, RouteMatchInterface $route_match) { function system_theme() { return array_merge(drupal_common_theme(), array( // Normally theme suggestion templates are only picked up when they are in - // themes. We explicitly define the block__system_branding_block theme - // suggestion here so that the template in core/modules/system/templates - // is picked up. + // themes. We explicitly define theme suggestions here so that the block + // templates in core/modules/system/templates are picked up. 'block__system_branding_block' => array( 'base hook' => 'block', 'template' => 'block--system-branding-block', ), + 'block__system_menu_block' => array( + 'base hook' => 'block', + 'template' => 'block--system-menu-block', + ), 'system_themes_page' => array( 'variables' => array( 'theme_groups' => array(), @@ -712,14 +715,6 @@ function system_preprocess_block(&$variables) { case 'system_help_block': $variables['attributes']['role'] = 'complementary'; break; - - case 'system_menu_block': - $menus = menu_list_system_menus(); - if (isset($menus[$variables['derivative_plugin_id']])) { - $variables['attributes']['role'] = 'navigation'; - $variables['attributes']['class'][] = 'block-menu'; - } - break; } } diff --git a/core/modules/system/templates/block--system-menu-block.html.twig b/core/modules/system/templates/block--system-menu-block.html.twig new file mode 100644 index 0000000..f21d259 --- /dev/null +++ b/core/modules/system/templates/block--system-menu-block.html.twig @@ -0,0 +1,48 @@ +{# +/** + * @file + * Default theme implementation for a menu block. + * + * Available variables: + * - … + * + * Headings should be used on navigation menus that consistently appears on + * multiple pages. When this menu block's label is configured to not be + * displayed, it is automatically made invisible using the 'visually-hidden' CSS + * class, which still keeps it visible for 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. + * + * @ingroup themeable + */ +#} +{% +set classes = [ +'block', +'block-menu', +'navigation', +] +%} +{% set heading_id = attributes.id ~ '-menu'|clean_id %} + + {# Block title. If not displayed, we still provide it for screen readers. #} + {% if not label_display %} + {% set title_attributes = title_attributes.addClass(['visually-hidden']) %} + {% endif %} + {{ title_prefix }} +

{{ configuration.label }}

+ {{ title_suffix }} + + {# Menu #} + {% if label_display %} + + {% endif %} + {% block content %} + {{ content }} + {% endblock %} + {% if label_display %} + + {% endif %} + diff --git a/core/modules/system/templates/menu-tree.html.twig b/core/modules/system/templates/menu-tree.html.twig index 03acca6..82a3d01 100644 --- a/core/modules/system/templates/menu-tree.html.twig +++ b/core/modules/system/templates/menu-tree.html.twig @@ -6,20 +6,6 @@ * 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() * @@ -27,14 +13,7 @@ */ #} {% if tree -%} - {%- if heading -%} - {%- if heading.level -%} - <{{ heading.level }}{{ heading.attributes }}>{{ heading.text }} - {%- else -%} - {{ heading.text }} - {%- endif -%} - {%- endif -%} - + {{ tree }} {%- endif %} diff --git a/core/modules/user/src/Tests/UserAccountLinksTests.php b/core/modules/user/src/Tests/UserAccountLinksTests.php index 4ad246b..97fa8a3 100644 --- a/core/modules/user/src/Tests/UserAccountLinksTests.php +++ b/core/modules/user/src/Tests/UserAccountLinksTests.php @@ -24,8 +24,12 @@ class UserAccountLinksTests extends WebTestBase { */ public static $modules = array('menu_ui', 'block', 'test_page_test'); + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_menu_block:account'); // Make test-page default. \Drupal::config('system.site')->set('page.front', 'test-page')->save(); } diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index 0ea06c0..2e61de5 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -22,9 +22,21 @@ class UserPasswordResetTest extends WebTestBase { */ protected $account; + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['block']; + + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_menu_block:account'); + // Create a user. $account = $this->drupalCreateUser(); diff --git a/core/modules/views/src/Tests/Wizard/MenuTest.php b/core/modules/views/src/Tests/Wizard/MenuTest.php index 505b4ce..ba3aa42 100644 --- a/core/modules/views/src/Tests/Wizard/MenuTest.php +++ b/core/modules/views/src/Tests/Wizard/MenuTest.php @@ -20,6 +20,8 @@ class MenuTest extends WizardTestBase { * Tests the menu functionality. */ function testMenus() { + $this->drupalPlaceBlock('system_menu_block:main'); + // Create a view with a page display and a menu link in the Main Menu. $view = array(); $view['label'] = $this->randomMachineName(16); diff --git a/core/profiles/standard/config/install/block.block.bartik_mainnavigation_level1.yml b/core/profiles/standard/config/install/block.block.bartik_mainnavigation_level1.yml index e1071ba..eb4b1dc 100644 --- a/core/profiles/standard/config/install/block.block.bartik_mainnavigation_level1.yml +++ b/core/profiles/standard/config/install/block.block.bartik_mainnavigation_level1.yml @@ -8,7 +8,7 @@ plugin: 'system_menu_block:main' settings: visibility: {} id: 'system_menu_block:main' - label: 'Main navigation (level 1)' + label: 'Main navigation' provider: system label_display: '0' cache: diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index bf18698..c402cf9 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -54,18 +54,7 @@ function bartik_preprocess_page(&$variables) { // Store back the classes to the htmlpage object. $attributes['class'] = $classes; -/* @todo Figure out how to replace this. - // Set additional attributes on the primary and secondary navigation menus. - if (!empty($variables['main_menu'])) { - $variables['main_menu']['#attributes']['id'] = 'main-menu-links'; - $variables['main_menu']['#attributes']['class'][] = 'links'; - } - if (!empty($variables['secondary_menu'])) { - $variables['secondary_menu']['#attributes']['id'] = 'secondary-menu-links'; - $variables['secondary_menu']['#attributes']['class'][] = 'links'; - $variables['secondary_menu']['#attributes']['class'][] = 'inline'; - } -*/ + // Set the options that apply to both page and maintenance page. _bartik_process_page($variables); diff --git a/core/themes/bartik/css/colors.css b/core/themes/bartik/css/colors.css index b52e01e..92f604f 100644 --- a/core/themes/bartik/css/colors.css +++ b/core/themes/bartik/css/colors.css @@ -8,8 +8,8 @@ body { } #page, #main-wrapper, -#main-menu-links li a.active, -#main-menu-links li.active-trail a { +#header .block-menu:first-child .menu li a.active, +#header .block-menu:first-child .menu li.active-trail a { background: #ffffff; } .tabs ul.primary li a.active { diff --git a/core/themes/bartik/css/layout.css b/core/themes/bartik/css/layout.css index 7374a10..68826b0 100644 --- a/core/themes/bartik/css/layout.css +++ b/core/themes/bartik/css/layout.css @@ -24,14 +24,6 @@ body, #header div.section { position: relative; } -.region-header { - float: right; /* LTR */ - margin: .5em 5px .75em; - border: 1px solid #ccc; -} -[dir="rtl"] .region-header { - float: left; -} #secondary-menu { width: 100%; margin: 0 auto; diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 6470a33..cb5a41e 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -420,6 +420,12 @@ h1.site-name { list-style-image: none; padding: 0; } +/* Treat menu blocks in the region header as a special case. */ +.region-header .block-menu { + float: none; + margin: 0; + font-size: inherit; +} .region-header .form-text { background: #fefefe; background: rgba(255, 255, 255, 0.7); @@ -441,30 +447,6 @@ h1.site-name { .region-header .form-required:after { background-image: url(../images/required.svg); } -/* Region header block menus. */ -.region-header .block-menu { - border: 1px solid; - border-color: #eee; - border-color: rgba(255, 255, 255, 0.2); - padding: 0; - width: 208px; -} -.region-header .block-menu li a { - display: block; - border-bottom: 1px solid; - border-bottom-color: #eee; - border-bottom-color: rgba(255, 255, 255, 0.2); - padding: 3px 7px; -} -.region-header .block-menu li a:hover, -.region-header .block-menu li a:active, -.region-header .block-menu li a:focus { - text-decoration: none; - background: rgba(255, 255, 255, 0.15); -} -.region-header .block-menu li:last-child a { - border-bottom: 0; -} /* User Login block in the header region */ .region-header #block-user-login { width: auto; @@ -547,19 +529,19 @@ h1.site-name { } /* --------------- Main Menu ------------ */ -#main-menu { +#header .block-menu:first-child { clear: both; } -#main-menu-links { +#header .block-menu:first-child .menu { font-size: 0.929em; margin: 0 5px; padding: 0; text-align: left; /* LTR */ } -[dir="rtl"] #main-menu-links { +[dir="rtl"] #header .block-menu:first-child .menu { text-align: right; } -#main-menu-links li { +#header .block-menu:first-child .menu li { float: none; list-style: none; margin: 0; @@ -567,7 +549,7 @@ h1.site-name { height: auto; width: 100%; } -#main-menu-links a { +#header .block-menu:first-child .menu a { color: #333; background: #ccc; background: rgba(255, 255, 255, 0.7); @@ -579,31 +561,38 @@ h1.site-name { margin: 4px 0; padding: 0.9em 0 0.9em 10px; /* LTR */ } -[dir="rtl"] #main-menu-links a { +[dir="rtl"] #header .block-menu:first-child .menu a { padding: 0.9em 10px 0.9em 0; } -#main-menu-links a:hover, -#main-menu-links a:focus { +#header .block-menu:first-child .menu a:hover, +#header .block-menu:first-child .menu a:focus { background: #f6f6f2; background: rgba(255, 255, 255, 0.95); } -#main-menu-links a:active { +#header .block-menu:first-child .menu a:active { background: #b3b3b3; background: rgba(255, 255, 255, 1); } -#main-menu-links li a.active { +#header .block-menu:first-child .menu li a.active { border-bottom: none; } /* ---------- Main Menu Toggle ----------- */ -#nav, #no-nav { +/* Hide the toggle by default. */ +#header .block-menu .menu-toggle, +#header .block-menu .menu-toggle-target { + display: none; +} +/* Unhide it for the main menu. */ +#header .block-menu:first-child .menu-toggle-target { + display: inherit; position: fixed; top: 0; } -.main-menu-reveal { +#header .block-menu:first-child .menu-toggle { display: none; } -body:not(:target) .main-menu-reveal { +body:not(:target) #header .block-menu:first-child .menu-toggle { color: #333; background: #ccc; background: rgba(255, 255, 255, 0.7); @@ -615,7 +604,7 @@ body:not(:target) .main-menu-reveal { padding: 0.9em 10px 0.9em 10px; z-index: 1000; } -body:not(:target) .main-menu-reveal:after { +body:not(:target) #header .block-menu:first-child .menu-toggle:after { content:""; background: url(../../../misc/icons/ffffff/hamburger.svg) no-repeat; background-size: contain; @@ -625,21 +614,21 @@ body:not(:target) .main-menu-reveal:after { position: absolute; right: 10px; /* LTR */ } -body:not(:target) #nav:target ~ .main-menu-reveal, -body:not(:target) .main-menu-reveal--hide { +body:not(:target) #header .block-menu:first-child .menu-toggle-target-show:target ~ .menu-toggle, +body:not(:target) #header .block-menu:first-child .menu-toggle--hide { display: none; } -body:not(:target) #nav:target ~ .main-menu-reveal--hide { +body:not(:target) #header .block-menu:first-child .menu-toggle-target-show:target ~ .menu-toggle--hide { display: block; } -[dir="rtl"] #secondary-menu-links { +[dir="rtl"] #header .block-menu:nt-child(2) { left: 10px; right: auto; } -#main-menu-links .menu-hide a { +#header .block-menu:first-child .menu .menu-hide a { display: none; } -body:not(:target) #nav:target ~ #main-menu-links .menu-hide a { +body:not(:target) #header .block-menu:first-child .menu-toggle-target-show:target ~ .menu .menu-hide a { background-color: transparent; border: none; display: block; @@ -652,35 +641,46 @@ body:not(:target) #nav:target ~ #main-menu-links .menu-hide a { text-indent: -999em; z-index: 1001; } -body:not(:target) #main-menu-links li { +body:not(:target) #header .block-menu:first-child .menu li { height: 0; overflow: hidden; } -body:not(:target) #nav:target ~ #main-menu-links li { +body:not(:target) #header .block-menu:first-child .menu-toggle-target-show:target ~ .menu li { height: auto; overflow: visible; } /* --------------- Secondary Menu ------------ */ - -#secondary-menu-links { +#header .block-menu:nth-child(2) { + border: 1px solid red; + position: absolute; + top: 0; + right: 0; /* LTR */ +} +[dir="rtl"] #header .block-menu:nth-child(2) { + right: inherit; + left: 0; +} +#header .block-menu:nth-child(2) .menu { float: right; /* LTR */ + right: 0; /* LTR */ font-size: 0.929em; margin: 0 10px; } -[dir="rtl"] #secondary-menu-links { +[dir="rtl"] #header .block-menu:nth-child(2) .menu { float: left; } -#secondary-menu-links li{ +#header .block-menu:nth-child(2) .menu li { margin: 0; padding: 0; + display: inline; } -#secondary-menu-links a { +#header .block-menu:nth-child(2) .menu a { display: inline-block; padding: 0.8em; } -#secondary-menu-links a:hover, -#secondary-menu-links a:focus { +#header .block-menu:nth-child(2) .menu a:hover, +#header .block-menu:nth-child(2) .menu a:focus { text-decoration: underline; } @@ -1875,7 +1875,7 @@ div.admin-panel .description { /* ------------ Header and Menus -------------------------- */ .region-header { - margin: .5em 5px .75em; + margin: 0 5px 0; } #logo, .site-logo { @@ -1889,13 +1889,13 @@ div.admin-panel .description { .site-branding-text { padding: 10px 10px 8px; } - #main-menu-links { + #header .block-menu .menu { margin: 0 5px; padding: 0; text-align: center; } - #main-menu-links li, - body:not(:target) #main-menu-links li { + #header .block-menu:first-child .menu li, + body:not(:target) #header .block-menu:first-child .menu li { float: left; /* LTR */ margin-right: 5px; /* LTR */ padding: 0; @@ -1904,26 +1904,26 @@ div.admin-panel .description { height: auto; overflow: visible; } - [dir="rtl"] #main-menu-links li { + [dir="rtl"] #header .block-menu:first-child .menu li { float: right; margin-left: 5px; margin-right: 0; } - #main-menu-links li:nth-child(3n) { + #header .block-menu:first-child .menu li:nth-child(3n) { margin-right: -5px; /* LTR */ } - [dir="rtl"] #main-menu-links li:nth-child(3n) { + [dir="rtl"] #header .block-menu:first-child .menu li:nth-child(3n) { margin-left: -5px; margin-right: 0; } - #main-menu-links a { + #header .block-menu:first-child .menu a { float: none; display: block; border-radius: 8px; margin-bottom: 5px; padding: 0.9em 5px; } - body:not(:target) .main-menu-reveal { + body:not(:target) #header .block-menu:first-child .menu-toggle { display: none; } } @@ -1931,7 +1931,7 @@ div.admin-panel .description { @media all and (min-width: 901px) { .region-header { - margin: 1em 5px 1.5em; + margin: 0 5px 0; } #logo, .site-logo { @@ -1954,13 +1954,13 @@ div.admin-panel .description { .site-name { font-size: 1.821em; } - #main-menu-links { + #header .block-menu:first-child .menu { font-size: 0.929em; margin: 0; padding: 0 15px; } - #main-menu-links li, - body:not(:target) #main-menu-links li { + #header .block-menu:first-child .menu li, + body:not(:target) #header .block-menu:first-child .menu li { float: left; /* LTR */ list-style: none; padding: 0 1px; @@ -1969,26 +1969,26 @@ div.admin-panel .description { height: auto; overflow: visible; } - [dir="rtl"] #main-menu-links li { + [dir="rtl"] #header .block-menu:first-child .menu li { float: right; } - #main-menu-links a { + #header .block-menu:first-child .menu a { float: left; /* LTR */ padding: 0.7em 0.8em; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } - [dir="rtl"] #main-menu-links a { + [dir="rtl"] #header .block-menu:first-child .menu a { float: right; padding: 0.7em 0.8em; } - .featured #main-menu-links li a:active, - .featured #main-menu-links li a.active { + .featured #header .block-menu:first-child .menu li a:active, + .featured #header .block-menu:first-child .menu li a.active { background: #f0f0f0; background: rgba(240, 240, 240, 1.0); } - body:not(:target) .main-menu-reveal { + body:not(:target) #header .block-menu:first-child .menu-toggle { display: none; } } diff --git a/core/themes/bartik/templates/block--system-menu-block.html.twig b/core/themes/bartik/templates/block--system-menu-block.html.twig new file mode 100644 index 0000000..1e81581 --- /dev/null +++ b/core/themes/bartik/templates/block--system-menu-block.html.twig @@ -0,0 +1,22 @@ +{% extends "@system/block--system-menu-block.html.twig" %} + +{# +/** + * @file + * Bartik's theme implementation for a menu block. + * + * @ingroup themeable + */ +#} +{% set show_anchor = "show-" ~ attributes.id|clean_id %} +{% set hide_anchor = "hide-" ~ attributes.id|clean_id %} +{% block content %} + {# When rendering a menu without label, render a menu toggle. #} + {% if not label_display %} + + + {{ 'Menu'|t }} + {{ 'Menu'|t }} + {% endif %} + {{ content }} +{% endblock %} diff --git a/core/themes/bartik/templates/page.html.twig b/core/themes/bartik/templates/page.html.twig index e5beb79..b6fb10f 100644 --- a/core/themes/bartik/templates/page.html.twig +++ b/core/themes/bartik/templates/page.html.twig @@ -77,14 +77,6 @@
{% if messages %}