Browse Source

used grid to align logo to fit design

Maggie 3 năm trước cách đây
mục cha
commit
23e1cfa4f4

+ 32 - 2
skatepark/assets/theme.css

@@ -548,9 +548,9 @@ header.wp-block-template-part {
 }
 
 header.wp-block-template-part > .wp-block-group {
-	align-items: flex-end;
+	gap: 0;
 	justify-content: space-between;
-	flex-wrap: wrap-reverse;
+	align-items: flex-start;
 }
 
 header.wp-block-template-part > .wp-block-group > * {
@@ -570,6 +570,36 @@ header.wp-block-template-part > .wp-block-group .wp-block-social-links.is-style-
 	padding: 0;
 }
 
+header.wp-block-template-part .site-brand {
+	margin-top: 20px;
+	display: grid;
+	grid-column-gap: 30px;
+	grid-template-columns: auto 1fr;
+}
+
+header.wp-block-template-part .site-brand .wp-block-site-logo {
+	grid-column-start: 1;
+	grid-column-end: 2;
+	grid-row-start: 1;
+	grid-row-end: 3;
+	margin: 0;
+	max-width: 120px;
+	align-self: center;
+	justify-self: flex-end;
+}
+
+header.wp-block-template-part .site-brand .wp-block-site-title {
+	grid-row-start: 1;
+	grid-row-end: 2;
+	margin: 0 0 0.5em;
+}
+
+header.wp-block-template-part .site-brand .wp-block-site-tagline {
+	grid-row-start: 2;
+	grid-row-end: 3;
+	margin: 0;
+}
+
 @media (max-width: 599px) {
 	.nav-links {
 		display: flex;

+ 2 - 2
skatepark/block-template-parts/header.html

@@ -1,7 +1,7 @@
 <!-- wp:group { "layout":{"type":"flex"}} -->
 <div class="wp-block-group">
-<!-- wp:group -->
-<div class="wp-block-group">
+<!-- wp:group {"className":"site-brand"} -->
+<div class="wp-block-group site-brand">
 <!-- wp:site-logo /-->
 <!-- wp:site-title /-->
 <!-- wp:site-tagline {"fontSize":"small","style":{"typography":{"fontWeight":"500"}}} /--></div>

+ 29 - 2
skatepark/sass/templates/_header.scss

@@ -4,9 +4,9 @@ header.wp-block-template-part {
 	width: 100%;
 	
 	> .wp-block-group {
-		align-items: flex-end; // Needed until theme.json layout lets me specify
+		gap: 0;
 		justify-content: space-between; // Apply a cluster (flex?) layout
-		flex-wrap: wrap-reverse;
+		align-items: flex-start;
 		> * {
 			flex-grow: 1; // Needed to maintain alignment when the containers stack
 			> * { // Apply a stack layout (page 69 of the every-layout.dev PDF) 
@@ -22,6 +22,33 @@ header.wp-block-template-part {
 			}
 		}
 	}
+
+	.site-brand {
+		margin-top: 20px;
+		display: grid;
+		grid-column-gap: 30px;
+		grid-template-columns: auto 1fr;
+		.wp-block-site-logo {
+			grid-column-start: 1;
+			grid-column-end: 2;
+			grid-row-start: 1;
+			grid-row-end: 3;
+			margin: 0;
+			max-width: 120px;
+			align-self: center;
+			justify-self: flex-end;
+		}
+		.wp-block-site-title {
+			grid-row-start: 1;
+			grid-row-end: 2;
+			margin: 0 0 0.5em;
+		}
+		.wp-block-site-tagline {
+			grid-row-start: 2;
+			grid-row-end: 3;
+			margin: 0;
+		}
+	}
 }
 
 @include break-small-only(){