ソースを参照

stack the site logo on alves and hever

Ben Dwyer 4 年 前
コミット
952143998c

+ 6 - 0
alves/sass/_extra-child-theme.scss

@@ -197,6 +197,12 @@ body:not(.fse-enabled) {
 			margin-bottom: 0;
 		}
 
+		&.has-logo:not(.has-title-and-tagline) {
+			grid-template-areas:
+				"site-logo main-navigation"
+				"site-logo social-navigation";
+		}
+
 		.site-logo {
 			grid-area: site-logo;
 			margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};

+ 4 - 1
alves/style-rtl.css

@@ -16,7 +16,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 This theme, like WordPress, is licensed under the GPL.
 Use it to make something cool, have fun, and share what you've learned with others.
 
-Varia is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
+Alves is a child theme of Varia which is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
 Underscores is distributed under the terms of the GNU GPL v2 or later.
 
 Normalizing styles have been helped along thanks to the fine work of
@@ -4145,6 +4145,9 @@ body:not(.fse-enabled) #masthead {
 		margin-top: 0;
 		margin-bottom: 0;
 	}
+	.site-header.has-logo:not(.has-title-and-tagline) {
+		grid-template-areas: "site-logo main-navigation" "site-logo social-navigation";
+	}
 	.site-header .site-logo {
 		grid-area: site-logo;
 		margin-bottom: 16px;

+ 4 - 1
alves/style.css

@@ -16,7 +16,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 This theme, like WordPress, is licensed under the GPL.
 Use it to make something cool, have fun, and share what you've learned with others.
 
-Varia is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
+Alves is a child theme of Varia which is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
 Underscores is distributed under the terms of the GNU GPL v2 or later.
 
 Normalizing styles have been helped along thanks to the fine work of
@@ -4174,6 +4174,9 @@ body:not(.fse-enabled) #masthead {
 		margin-top: 0;
 		margin-bottom: 0;
 	}
+	.site-header.has-logo:not(.has-title-and-tagline) {
+		grid-template-areas: "site-logo main-navigation" "site-logo social-navigation";
+	}
 	.site-header .site-logo {
 		grid-area: site-logo;
 		margin-bottom: 16px;

+ 6 - 0
hever/sass/_extra-child-theme.scss

@@ -82,6 +82,12 @@ body:not(.fse-enabled) {
 			margin-bottom: 0;
 		}
 
+		&.has-logo:not(.has-title-and-tagline) {
+			grid-template-areas:
+				"site-logo main-navigation"
+				"site-logo social-navigation";
+		}
+
 		.site-logo {
 			grid-area: site-logo;
 			margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};

+ 4 - 1
hever/style-rtl.css

@@ -16,7 +16,7 @@ Tags: full-site-editing, one-column, flexible-header, accessibility-ready, custo
 This theme, like WordPress, is licensed under the GPL.
 Use it to make something cool, have fun, and share what you've learned with others.
 
-Hever is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
+Hever is a child theme of Varia which is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
 Underscores is distributed under the terms of the GNU GPL v2 or later.
 
 Normalizing styles have been helped along thanks to the fine work of
@@ -4077,6 +4077,9 @@ body:not(.fse-enabled) #colophon {
 		margin-top: 0;
 		margin-bottom: 0;
 	}
+	.site-header.has-logo:not(.has-title-and-tagline) {
+		grid-template-areas: "site-logo main-navigation" "site-logo social-navigation";
+	}
 	.site-header .site-logo {
 		grid-area: site-logo;
 		margin-bottom: 16px;

+ 4 - 1
hever/style.css

@@ -16,7 +16,7 @@ Tags: full-site-editing, one-column, flexible-header, accessibility-ready, custo
 This theme, like WordPress, is licensed under the GPL.
 Use it to make something cool, have fun, and share what you've learned with others.
 
-Hever is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
+Hever is a child theme of Varia which is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
 Underscores is distributed under the terms of the GNU GPL v2 or later.
 
 Normalizing styles have been helped along thanks to the fine work of
@@ -4106,6 +4106,9 @@ body:not(.fse-enabled) #colophon {
 		margin-top: 0;
 		margin-bottom: 0;
 	}
+	.site-header.has-logo:not(.has-title-and-tagline) {
+		grid-template-areas: "site-logo main-navigation" "site-logo social-navigation";
+	}
 	.site-header .site-logo {
 		grid-area: site-logo;
 		margin-bottom: 16px;

+ 1 - 1
morden/header.php

@@ -26,7 +26,7 @@
 		wp_body_open();
 	}
 ?>
-	
+
 <div id="page" class="site">
 	<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'varia' ); ?></a>
 

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

@@ -116,6 +116,12 @@ body {
 			margin-bottom: 0;
 		}
 
+		&.has-logo:not(.has-title-and-tagline) {
+			grid-template-areas:
+				"site-logo main-navigation"
+				"site-logo social-navigation";
+		}
+
 		.site-logo {
 			grid-area: site-logo;
 			margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};

+ 1 - 1
varia/header.php

@@ -13,7 +13,7 @@
 $has_primary_nav = has_nav_menu( 'menu-1' );
 $header_classes  = 'site-header responsive-max-width';
 $header_classes .= has_custom_logo() ? ' has-logo' : '';
-$header_classes .= true === get_theme_mod( 'display_title_and_tagline', true ) ? ' has-title-and-tagline' : '';
+$header_classes .= 1 === get_theme_mod( 'header_text', true ) ? ' has-title-and-tagline' : '';
 $header_classes .= $has_primary_nav ? ' has-menu' : '';
 ?><!doctype html>
 <html <?php language_attributes(); ?>>

+ 2 - 2
varia/inc/wpcom.php

@@ -18,8 +18,8 @@ function varia_wpcom_setup() {
 	// Disable automatically generated color palettes.
 	add_theme_support( 'wpcom-colors', array(
 	        'only-featured-palettes' => true,
-	) );	
-	
+	) );
+
 	// Set theme colors for third party services.
 	if ( ! isset( $themecolors ) ) {
 		$themecolors = array(

+ 13 - 18
varia/template-parts/header/site-branding.php

@@ -6,32 +6,27 @@
  * @subpackage Varia
  * @since 1.0.0
  */
-$blog_info    = get_bloginfo( 'name' );
-$description  = get_bloginfo( 'description', 'display' );
-$show_title   = ( true === get_theme_mod( 'display_title_and_tagline', true ) );
-$header_class = $show_title ? 'site-title' : 'screen-reader-text';
-
 ?>
-
-<?php if ( has_custom_logo() && $show_title ) : ?>
-	<div class="site-logo"><?php the_custom_logo(); ?></div>
-<?php endif; ?>
-
 <div class="site-branding">
-	<?php if ( has_custom_logo() && ! $show_title ) : ?>
+
+	<?php if ( has_custom_logo() ) : ?>
 		<div class="site-logo"><?php the_custom_logo(); ?></div>
 	<?php endif; ?>
-	<?php if ( ! empty( $blog_info ) && $show_title ) : ?>
+	<?php $blog_info = get_bloginfo( 'name' ); ?>
+	<?php if ( ! empty( $blog_info ) ) : ?>
 		<?php if ( is_front_page() && is_home() ) : ?>
-			<h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $blog_info; ?></a></h1>
+			<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
 		<?php else : ?>
-			<p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $blog_info; ?></a></p>
+			<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
 		<?php endif; ?>
 	<?php endif; ?>
 
-	<?php if ( ( $description || is_customize_preview() ) && $show_title ) : ?>
-		<p class="site-description">
-			<?php echo $description; ?>
-		</p>
+	<?php
+	$description = get_bloginfo( 'description', 'display' );
+	if ( $description || is_customize_preview() ) :
+		?>
+			<p class="site-description">
+				<?php echo $description; ?>
+			</p>
 	<?php endif; ?>
 </div><!-- .site-branding -->