Browse Source

Updates to take into accout the site logo & when the menu is not there.

Enej Bajgoric 4 years ago
parent
commit
6c078f86fc

+ 4 - 3
alves/sass/_extra-child-theme.scss

@@ -574,10 +574,11 @@ body:not(.fse-enabled) {
 }
 
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
-		margin-right: 140px; /** this number is a bit magic. */
+		margin-right: 145px; /** this number is a bit magic. */
 	}
 }
 

+ 4 - 3
alves/style-rtl.css

@@ -4447,9 +4447,10 @@ body:not(.fse-enabled) #masthead {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
-		margin-left: 140px;
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
+		margin-left: 145px;
 		/** this number is a bit magic. */
 	}
 }

+ 4 - 3
alves/style.css

@@ -4476,9 +4476,10 @@ body:not(.fse-enabled) #masthead {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
-		margin-right: 140px;
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
+		margin-right: 145px;
 		/** this number is a bit magic. */
 	}
 }

+ 3 - 2
barnsbury/sass/_extra-child-theme.scss

@@ -394,8 +394,9 @@ a {
 	}
 }
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
 		margin-right: 100px; /** this number is a bit magic. */
 	}

+ 3 - 2
barnsbury/style-rtl.css

@@ -4392,8 +4392,9 @@ body.admin-bar .widget_eu_cookie_law_widget.widget.top {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-left: 100px;
 		/** this number is a bit magic. */
 	}

+ 3 - 2
barnsbury/style.css

@@ -4421,8 +4421,9 @@ body.admin-bar .widget_eu_cookie_law_widget.widget.top {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-right: 100px;
 		/** this number is a bit magic. */
 	}

+ 7 - 2
dalston/header.php

@@ -10,6 +10,11 @@
  * @subpackage Varia
  * @since 1.0.0
  */
+$has_primary_nav = has_nav_menu( 'menu-1' );
+$header_classes  = 'site-header';
+$header_classes .= has_custom_logo() ? ' has-logo' : '';
+$header_classes .= 1 === get_theme_mod( 'header_text', 1 ) ? ' has-title-and-tagline' : '';
+$header_classes .= $has_primary_nav ? ' has-menu' : '';
 ?><!doctype html>
 <html <?php language_attributes(); ?>>
 <head>
@@ -41,11 +46,11 @@
 
 	<?php else : // Otherwise we'll fallback to the default Varia header below. ?>
 
-		<header id="masthead" class="site-header">
+		<header id="masthead" class="<?php echo $header_classes; ?>" role="banner" >
 
 			<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
 
-			<?php if ( has_nav_menu( 'menu-1' ) ) : ?>
+			<?php if ( $has_primary_nav) : ?>
 				<nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'varia' ); ?>">
 					<input type="checkbox" role="button" aria-haspopup="true" id="toggle" class="hide-visually">
 					<label for="toggle" id="toggle-menu" class="button">

+ 4 - 3
dalston/sass/_extra-child-theme.scss

@@ -319,8 +319,9 @@ a {
 }
 
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
 		margin-right: 90px; /** This number is magic. */
 	}
@@ -330,7 +331,7 @@ a {
 	@include media(mobile-only) {
 		#toggle-menu {
 			position: absolute;
-			top: $baseline-unit;
+			top: 2 * $baseline-unit;
 			right: 2 * $baseline-unit;
 		}
 

+ 4 - 3
dalston/style-rtl.css

@@ -4269,8 +4269,9 @@ a {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-left: 90px;
 		/** This number is magic. */
 	}
@@ -4279,7 +4280,7 @@ a {
 @media only screen and (max-width: 559px) {
 	.mobile-nav-side .main-navigation #toggle-menu {
 		position: absolute;
-		top: 8px;
+		top: 16px;
 		left: 16px;
 	}
 	.mobile-nav-side .main-navigation .dropdown-icon {

+ 4 - 3
dalston/style.css

@@ -4298,8 +4298,9 @@ a {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-right: 90px;
 		/** This number is magic. */
 	}
@@ -4308,7 +4309,7 @@ a {
 @media only screen and (max-width: 559px) {
 	.mobile-nav-side .main-navigation #toggle-menu {
 		position: absolute;
-		top: 8px;
+		top: 16px;
 		right: 16px;
 	}
 	.mobile-nav-side .main-navigation .dropdown-icon {

+ 3 - 2
hever/sass/_extra-child-theme.scss

@@ -493,8 +493,9 @@ article .entry-header .entry-title,
 }
 
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
 		margin-right: 110px; /** This number is magic. */
 	}

+ 3 - 2
hever/style-rtl.css

@@ -4469,8 +4469,9 @@ article .entry-header .entry-title a:active, article .entry-header .entry-title
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-left: 110px;
 		/** This number is magic. */
 	}

+ 3 - 2
hever/style.css

@@ -4498,8 +4498,9 @@ article .entry-header .entry-title a:active, article .entry-header .entry-title
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-right: 110px;
 		/** This number is magic. */
 	}

+ 12 - 5
mayland/sass/_extra-child-theme.scss

@@ -311,24 +311,31 @@ a {
 }
 
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
 		margin-right: 90px; /** This number is magic. */
 	}
 }
 /* This is also mayland specific */
-.mobile-nav-side .site-title {
+.mobile-nav-side .has-menu .site-title {
 	@include media(mobile-only) {
-		margin-bottom: 2 * $baseline-unit;
+		margin-bottom: 3 * $baseline-unit;
 	}
 }
+.mobile-nav-side .has-logo .site-title {
+	@include media(mobile-only) {
+		margin-bottom: 0;
+	}
+}
+
 
 .mobile-nav-side .main-navigation {
 	@include media(mobile-only) {
 		#toggle-menu {
 			position: absolute;
-			top: $baseline-unit; /* This is mayland specific */
+			top: 2 * $baseline-unit; /* This is mayland specific */
 			right: 2 * $baseline-unit;
 		}
 

+ 12 - 5
mayland/style-rtl.css

@@ -4298,8 +4298,9 @@ strong {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-left: 90px;
 		/** This number is magic. */
 	}
@@ -4307,15 +4308,21 @@ strong {
 
 /* This is also mayland specific */
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title {
-		margin-bottom: 16px;
+	.mobile-nav-side .has-menu .site-title {
+		margin-bottom: 24px;
+	}
+}
+
+@media only screen and (max-width: 559px) {
+	.mobile-nav-side .has-logo .site-title {
+		margin-bottom: 0;
 	}
 }
 
 @media only screen and (max-width: 559px) {
 	.mobile-nav-side .main-navigation #toggle-menu {
 		position: absolute;
-		top: 8px;
+		top: 16px;
 		/* This is mayland specific */
 		left: 16px;
 	}

+ 12 - 5
mayland/style.css

@@ -4327,8 +4327,9 @@ strong {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-right: 90px;
 		/** This number is magic. */
 	}
@@ -4336,15 +4337,21 @@ strong {
 
 /* This is also mayland specific */
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title {
-		margin-bottom: 16px;
+	.mobile-nav-side .has-menu .site-title {
+		margin-bottom: 24px;
+	}
+}
+
+@media only screen and (max-width: 559px) {
+	.mobile-nav-side .has-logo .site-title {
+		margin-bottom: 0;
 	}
 }
 
 @media only screen and (max-width: 559px) {
 	.mobile-nav-side .main-navigation #toggle-menu {
 		position: absolute;
-		top: 8px;
+		top: 16px;
 		/* This is mayland specific */
 		right: 16px;
 	}

+ 4 - 3
morden/sass/_extra-child-theme.scss

@@ -611,10 +611,11 @@ article .entry-header .entry-title,
 }
 
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
-		margin-right: 110px; /** This number is magic. */
+		margin-right: 115px; /** This number is magic. */
 	}
 }
 

+ 4 - 3
morden/style-rtl.css

@@ -4562,9 +4562,10 @@ article .entry-header .entry-title a:active, article .entry-header .entry-title
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
-		margin-left: 110px;
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
+		margin-left: 115px;
 		/** This number is magic. */
 	}
 }

+ 4 - 3
morden/style.css

@@ -4591,9 +4591,10 @@ article .entry-header .entry-title a:active, article .entry-header .entry-title
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
-		margin-right: 110px;
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
+		margin-right: 115px;
 		/** This number is magic. */
 	}
 }

+ 8 - 2
rivington/header.php

@@ -10,6 +10,12 @@
  * @subpackage Rivington
  * @since 1.0.0
  */
+
+$has_primary_nav = has_nav_menu( 'menu-1' );
+$header_classes  = 'site-header responsive-max-width';
+$header_classes .= has_custom_logo() ? ' has-logo' : '';
+$header_classes .= 1 === get_theme_mod( 'header_text', 1 ) ? ' has-title-and-tagline' : '';
+$header_classes .= $has_primary_nav ? ' has-menu' : '';
 ?><!doctype html>
 <html <?php language_attributes(); ?>>
 <head>
@@ -41,10 +47,10 @@
 
 	<?php else : // Otherwise we'll fallback to the default header below. ?>
 
-		<header id="masthead" class="site-header responsive-max-width">
+		<header id="masthead" class="<?php echo $header_classes; ?>" role="banner">
 			<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
 
-			<?php if ( has_nav_menu( 'menu-1' ) ) : ?>
+			<?php if ( $has_primary_nav ) : ?>
 				<nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'rivington' ); ?>">
 					<input type="checkbox" role="button" aria-haspopup="true" id="toggle" class="hide-visually">
 					<label for="toggle" id="toggle-menu" class="button">

+ 4 - 3
rivington/sass/_extra-child-theme.scss

@@ -459,8 +459,9 @@ a {
 }
 
 // Updates the Mobile Navigation to be next to the site title.
-.mobile-nav-side .site-title,
-.mobile-nav-side .site-description {
+.mobile-nav-side .has-menu .site-logo,
+.mobile-nav-side .has-menu .site-title,
+.mobile-nav-side .has-menu .site-description {
 	@include media(mobile-only) {
 		margin-right: 90px; /** This number is magic. */
 	}
@@ -470,7 +471,7 @@ a {
 	@include media(mobile-only) {
 		#toggle-menu {
 			position: absolute;
-			top: $baseline-unit; /* This is rivington specific */
+			top: 2 * $baseline-unit;
 			right: 2 * $baseline-unit;
 		}
 

+ 4 - 3
rivington/style-rtl.css

@@ -4425,8 +4425,9 @@ p:not(.site-title) a:hover {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-left: 90px;
 		/** This number is magic. */
 	}
@@ -4435,7 +4436,7 @@ p:not(.site-title) a:hover {
 @media only screen and (max-width: 559px) {
 	.mobile-nav-side .main-navigation #toggle-menu {
 		position: absolute;
-		top: 8px;
+		top: 16px;
 		/* This is rivington specific */
 		left: 16px;
 	}

+ 4 - 3
rivington/style.css

@@ -4454,8 +4454,9 @@ p:not(.site-title) a:hover {
 }
 
 @media only screen and (max-width: 559px) {
-	.mobile-nav-side .site-title,
-	.mobile-nav-side .site-description {
+	.mobile-nav-side .has-menu .site-logo,
+	.mobile-nav-side .has-menu .site-title,
+	.mobile-nav-side .has-menu .site-description {
 		margin-right: 90px;
 		/** This number is magic. */
 	}
@@ -4464,7 +4465,7 @@ p:not(.site-title) a:hover {
 @media only screen and (max-width: 559px) {
 	.mobile-nav-side .main-navigation #toggle-menu {
 		position: absolute;
-		top: 8px;
+		top: 16px;
 		/* This is rivington specific */
 		right: 16px;
 	}