diff --git a/core/themes/bartik/css/style-rtl.css b/core/themes/bartik/css/style-rtl.css index dc7c2a4..d9dc124 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -72,7 +72,14 @@ ul.tips { #main-menu ul.links li, #main-menu ul.links li a { - float: right; + float: none; +} + +/* ---------- Main Menu Toggle ----------- */ + +body:not(:target) #main-menu-reveal:after { + left: 10px; + right: auto; } /* --------------- Secondary Menu ------------ */ @@ -266,4 +273,21 @@ ul.tips { padding: 0 2px 4px 0; } +/* ----------- media queries ------------------------------- */ + +@media all and (min-width: 461px) and (max-width: 900px) { + /* ------------ Header and Menus -------------------------- */ + #main-menu ul.links li { + float: right; + } +} + +@media all and (min-width: 901px) { + /* ------------ Header and Menus -------------------------- */ + #main-menu ul.links li, + #main-menu ul.links li a { + float: right; + } +} + /* @end */ diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 44deab1..a393531 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -483,6 +483,7 @@ h1#site-name { list-style: none; margin: 0; padding: 0; + height: auto; width: 100%; } #main-menu-links a { @@ -510,6 +511,58 @@ h1#site-name { border-bottom: none; } +/* ---------- Main Menu Toggle ----------- */ + +#main-menu-reveal { + display: none; +} +body:not(:target) #main-menu-reveal { + color: #333; + background: #ccc; + background: rgba(255, 255, 255, 0.7); + float: none; + font-size: 0.929em; + display: block; + text-decoration: none; + text-shadow: 0 1px #eee; + padding: 0.9em 10px 0.9em 10px; + z-index: 1000; +} +body:not(:target) #main-menu-reveal:after { + content:""; + background: url('../images/toggle.png') no-repeat; + width: 22px; + height: 22px; + display: inline-block; + position: absolute; + right: 10px; +} +#main-menu-links .menu-hide a { + display: none; +} +body:not(:target) #main-menu-links:target .menu-hide a { + background-color: transparent; + border: none; + display: block; + width: 100%; + height: auto; + position: absolute; + left: 0; + right: 0; + overflow: hidden; + text-indent: 100%; + white-space: nowrap; + z-index: 1001; +} +body:not(:target) #main-menu-links li { + height: 0; + overflow: hidden; +} +body:not(:target) #main-menu-links:target li { + height: auto; + overflow: visible; +} + /* --------------- Secondary Menu ------------ */ #secondary-menu-links { @@ -1539,12 +1592,15 @@ div.admin-panel .description { padding: 0; text-align: center; } - #main-menu-links li { + #main-menu-links li, + body:not(:target) #main-menu-links li { float: left; margin-right: 5px; padding: 0; display: inline-block; width: 32.75%; + height: auto; + overflow: visible; } #main-menu-links li:nth-child(3n) { margin-right: -5px; @@ -1556,6 +1612,9 @@ div.admin-panel .description { margin-bottom: 5px; padding: 0.9em 5px; } + body:not(:target) #main-menu-reveal { + display: none; + } } @media all and (min-width: 901px) { @@ -1578,12 +1637,15 @@ div.admin-panel .description { margin: 0; padding: 0 15px; } - #main-menu-links li { + #main-menu-links li, + body:not(:target) #main-menu-links li { float: left; /* LTR */ list-style: none; padding: 0 1px; margin: 0 1px; width: auto; + height: auto; + overflow: visible; } #main-menu-links a { float: left; /* LTR */ @@ -1597,6 +1659,9 @@ div.admin-panel .description { background: #f0f0f0; background: rgba(240, 240, 240, 1.0); } + body:not(:target) #main-menu-reveal { + display: none; + } } @media all and (min-width: 520px) { diff --git a/core/themes/bartik/images/toggle.png b/core/themes/bartik/images/toggle.png new file mode 100644 index 0000000..33551b8 --- /dev/null +++ b/core/themes/bartik/images/toggle.png @@ -0,0 +1,4 @@ +PNG + + IHDRĴl;tEXtSoftwareAdobe ImageReadyqe<"iTXtXML:com.adobe.xmp "EIDATxԕ;0D"%\)}tA +38NZ7ONbuf>Wp@QK0 `Ow' ~3xj'JM$fplvfwGWA,cs7gƲ9]^}QOxD\ )>ӟ9+ VIENDB` \ No newline at end of file diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php index 9a6c8a9..16d44e6 100644 --- a/core/themes/bartik/template.php +++ b/core/themes/bartik/template.php @@ -75,6 +75,15 @@ function bartik_process_page(&$variables) { // Make sure the shortcut link is the first item in title_suffix. $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } + // Add a hide menu item to the main menu + if ($variables['main_menu']) { + $variables['main_menu']['menu-hide'] = array( + 'title' => t('Hide menu'), + 'href' => '', + 'fragment' => ' ', + 'external' => TRUE, + ); + } } /** diff --git a/core/themes/bartik/templates/page.tpl.php b/core/themes/bartik/templates/page.tpl.php index 08cc357..207a123 100644 --- a/core/themes/bartik/templates/page.tpl.php +++ b/core/themes/bartik/templates/page.tpl.php @@ -156,6 +156,7 @@ 'class' => array('element-invisible'), ), )); ?> +