Przeglądaj źródła

FIX #1449: Implement CSS-only solution

Niels Lange 5 lat temu
rodzic
commit
45625e1653

+ 0 - 14
shawburn/functions.php

@@ -181,17 +181,3 @@ function shawburn_editor_styles() {
 	wp_enqueue_style( 'shawburn-editor-fonts', shawburn_fonts_url(), array(), null );
 }
 add_action( 'enqueue_block_editor_assets', 'shawburn_editor_styles' );
-
-/**
- * Add custom body classes.
- *
- * @param array $classes The existing body classes.
- * @return array $classes The updated body classes.
- */
-function shawburn_body_classes( $classes ) {
-	if ( ! has_nav_menu( 'social' ) ) {
-		$classes[] = 'has-no-social-menu';
-	}
-	return $classes;
-}
-add_filter( 'body_class', 'shawburn_body_classes' );

+ 8 - 15
shawburn/sass/_extra-child-theme.scss

@@ -12,7 +12,7 @@ body {
 	.hentry .entry-content {
 		& > *:first-child {
 			&.alignfull {
-				margin-top: -#{2 * map-deep-get($config-global, "spacing", "unit")};
+				margin-top: -#{map-deep-get($config-global, "spacing", "unit")};
 
 				@include media(mobile) {
 					margin-top: -#{3 * map-deep-get($config-global, "spacing", "unit")};
@@ -22,25 +22,12 @@ body {
 	}
 }
 
-.home.has-no-social-menu.hide-homepage-title {
-	.hentry .entry-content {
-		& > *:first-child {
-			&.alignfull {
-				margin-top: -#{1 * map-deep-get($config-global, "spacing", "unit")};
-
-				@include media(mobile) {
-					margin-top: -#{2 * map-deep-get($config-global, "spacing", "unit")};
-				}
-			}
-		}
-	}
-}
-
 a {
 	text-decoration: none;
 }
 
 .main-navigation {
+	margin-bottom: 0;
 	text-transform: uppercase;
 }
 
@@ -151,6 +138,12 @@ hr.wp-block-separator.is-style-wide,
 	padding: 0;
 }
 
+.site-main {
+	@include media(mobile) {
+		padding-top: #{3 * map-deep-get($config-global, "spacing", "unit")};
+	}
+}
+
 #page {
 	.entry-header,
 	.page-header,

+ 8 - 11
shawburn/style-rtl.css

@@ -3407,7 +3407,7 @@ body {
 }
 
 .home.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
-	margin-top: -32px;
+	margin-top: -16px;
 }
 
 @media only screen and (min-width: 560px) {
@@ -3416,21 +3416,12 @@ body {
 	}
 }
 
-.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
-	margin-top: -16px;
-}
-
-@media only screen and (min-width: 560px) {
-	.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
-		margin-top: -32px;
-	}
-}
-
 a {
 	text-decoration: none;
 }
 
 .main-navigation {
+	margin-bottom: 0;
 	text-transform: uppercase;
 }
 
@@ -3546,6 +3537,12 @@ hr.wp-block-separator.is-style-wide,
 	padding: 0;
 }
 
+@media only screen and (min-width: 640px) {
+	.site-main {
+		padding-top: 48px;
+	}
+}
+
 #page .entry-header,
 #page .page-header,
 #page .entry-footer,

+ 8 - 11
shawburn/style.css

@@ -3436,7 +3436,7 @@ body {
 }
 
 .home.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
-	margin-top: -32px;
+	margin-top: -16px;
 }
 
 @media only screen and (min-width: 560px) {
@@ -3445,21 +3445,12 @@ body {
 	}
 }
 
-.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
-	margin-top: -16px;
-}
-
-@media only screen and (min-width: 560px) {
-	.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
-		margin-top: -32px;
-	}
-}
-
 a {
 	text-decoration: none;
 }
 
 .main-navigation {
+	margin-bottom: 0;
 	text-transform: uppercase;
 }
 
@@ -3575,6 +3566,12 @@ hr.wp-block-separator.is-style-wide,
 	padding: 0;
 }
 
+@media only screen and (min-width: 560px) {
+	.site-main {
+		padding-top: 48px;
+	}
+}
+
 #page .entry-header,
 #page .page-header,
 #page .entry-footer,