From 252149899f0f82476999b9d0127c93a75cbe12a5 Mon Sep 17 00:00:00 2001 From: mike-esokia Date: Mon, 28 May 2018 14:20:41 +0400 Subject: [PATCH] convert navigation menu to dropdown on small screen --- resources/www/_shared/styles/_main-menu.scss | 45 +++++++ templates/web/common/menubar.html.twig | 133 +++++++++++-------- 2 files changed, 120 insertions(+), 58 deletions(-) diff --git a/resources/www/_shared/styles/_main-menu.scss b/resources/www/_shared/styles/_main-menu.scss index 64d3ab17ab..0b4b55ee9c 100644 --- a/resources/www/_shared/styles/_main-menu.scss +++ b/resources/www/_shared/styles/_main-menu.scss @@ -19,6 +19,18 @@ $mainMenuBottomBorder: none !default; margin-bottom: $mainMenuMarginBottom; z-index: 100; box-sizing: border-box; + .show-menu { + display: none; + i { + font-size: 26px; + vertical-align: middle; + color: $mainMenuLinkActiveColor; + } + /*Show menu when invisible checkbox is checked*/ + input[type=checkbox]:checked ~ #nav_menu { + display: block; + } + } ol { display: block; margin: 0; @@ -96,3 +108,36 @@ $mainMenuBottomBorder: none !default; } } } + +@media screen and (max-width: 760px) { + #mainMenu { + .show-menu { + display: block; + } + #nav_menu { + display: none; + z-index: 1000; + ol { + position: static; + } + li.menu-bar-item { + width: 100%; + clear: both; + background: $mainMenuBackgroundColor; + border-bottom: 1px solid $mainMenuLinkActiveColor; + z-index: 1000; + } + li.menu-bar-item a { + width: 100%; + > span { + text-align: center; + font-size: 14px; + font-weight: bold; + &.selected { + border-top: none !important; + } + } + } + } + } +} diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 97831a327f..672c3af509 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -1,104 +1,109 @@