Explorar el Código

Update the Morden theme to have the mobile nav on the side.

Enej Bajgoric hace 4 años
padre
commit
5e371dd302
Se han modificado 4 ficheros con 96 adiciones y 0 borrados
  1. 3 0
      morden/functions.php
  2. 31 0
      morden/sass/_extra-child-theme.scss
  3. 31 0
      morden/style-rtl.css
  4. 31 0
      morden/style.css

+ 3 - 0
morden/functions.php

@@ -99,6 +99,9 @@ if ( ! function_exists( 'morden_setup' ) ) :
 				),
 				),
 			)
 			)
 		);
 		);
+
+		// Add mobile-on-side body class.
+		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 	}
 endif;
 endif;
 add_action( 'after_setup_theme', 'morden_setup', 12 );
 add_action( 'after_setup_theme', 'morden_setup', 12 );

+ 31 - 0
morden/sass/_extra-child-theme.scss

@@ -609,3 +609,34 @@ article .entry-header .entry-title,
 		width: 100%;
 		width: 100%;
 	}
 	}
 }
 }
+
+// Updates the Mobile Navigation to be next to the site title.
+.mobile-nav-side .site-title,
+.mobile-nav-side .site-description {
+	@include media(mobile-only) {
+		margin-right: 110px; /** This number is magic. */
+	}
+}
+
+.mobile-nav-side .main-navigation {
+	@include media(mobile-only) {
+		#toggle-menu {
+			position: absolute;
+			top: 0; /** Specific to Morden **/
+			right: 0; /** Specific to Morden **/
+		}
+
+		.menu-main-menu-container {
+			background: transparent; /** Specific to Morden **/
+			margin:0 ( -2 * $baseline-unit );
+			padding: 0 (2 * $baseline-unit) $baseline-unit;
+			.sub-menu {
+				padding-left: 2 * $baseline-unit;
+			}
+			a {
+				padding: $baseline-unit 0;
+				line-height: 1;
+			}
+		}
+	}
+}

+ 31 - 0
morden/style-rtl.css

@@ -4561,6 +4561,37 @@ article .entry-header .entry-title a:active, article .entry-header .entry-title
 	width: 100%;
 	width: 100%;
 }
 }
 
 
+@media only screen and (max-width: 559px) {
+	.mobile-nav-side .site-title,
+	.mobile-nav-side .site-description {
+		margin-left: 110px;
+		/** This number is magic. */
+	}
+}
+
+@media only screen and (max-width: 559px) {
+	.mobile-nav-side .main-navigation #toggle-menu {
+		position: absolute;
+		top: 0;
+		/** Specific to Morden **/
+		left: 0;
+		/** Specific to Morden **/
+	}
+	.mobile-nav-side .main-navigation .menu-main-menu-container {
+		background: transparent;
+		/** Specific to Morden **/
+		margin: 0 -16px;
+		padding: 0 16px 8px;
+	}
+	.mobile-nav-side .main-navigation .menu-main-menu-container .sub-menu {
+		padding-right: 16px;
+	}
+	.mobile-nav-side .main-navigation .menu-main-menu-container a {
+		padding: 8px 0;
+		line-height: 1;
+	}
+}
+
 /**
 /**
  * Full Site Editing
  * Full Site Editing
  * - Full Site Editing overrides
  * - Full Site Editing overrides

+ 31 - 0
morden/style.css

@@ -4590,6 +4590,37 @@ article .entry-header .entry-title a:active, article .entry-header .entry-title
 	width: 100%;
 	width: 100%;
 }
 }
 
 
+@media only screen and (max-width: 559px) {
+	.mobile-nav-side .site-title,
+	.mobile-nav-side .site-description {
+		margin-right: 110px;
+		/** This number is magic. */
+	}
+}
+
+@media only screen and (max-width: 559px) {
+	.mobile-nav-side .main-navigation #toggle-menu {
+		position: absolute;
+		top: 0;
+		/** Specific to Morden **/
+		right: 0;
+		/** Specific to Morden **/
+	}
+	.mobile-nav-side .main-navigation .menu-main-menu-container {
+		background: transparent;
+		/** Specific to Morden **/
+		margin: 0 -16px;
+		padding: 0 16px 8px;
+	}
+	.mobile-nav-side .main-navigation .menu-main-menu-container .sub-menu {
+		padding-left: 16px;
+	}
+	.mobile-nav-side .main-navigation .menu-main-menu-container a {
+		padding: 8px 0;
+		line-height: 1;
+	}
+}
+
 /**
 /**
  * Full Site Editing
  * Full Site Editing
  * - Full Site Editing overrides
  * - Full Site Editing overrides