瀏覽代碼

tweaked query blocks styles

Maggie 3 年之前
父節點
當前提交
2f2a9a5657

+ 34 - 0
skatepark/assets/theme.css

@@ -206,6 +206,15 @@
 	text-decoration: none;
 }
 
+.wp-block-query-pagination .wp-block-query-pagination-numbers .current {
+	text-decoration-thickness: 0.07em;
+	text-underline-offset: 0.46ex;
+}
+
+.wp-block-query-pagination .wp-block-query-pagination-numbers .page-numbers {
+	padding: 10px;
+}
+
 .wp-block-search .wp-block-search__button:active, .wp-block-search .wp-block-search__button:focus {
 	outline-offset: -0.25em;
 }
@@ -305,6 +314,10 @@
 	text-indent: 10em;
 }
 
+.is-style-indented-post-excerpt p {
+	text-indent: 5em;
+}
+
 .pre-footer h3 {
 	text-transform: uppercase;
 }
@@ -429,4 +442,25 @@ header.wp-block-template-part > .wp-block-group .wp-block-social-links.is-style-
 	margin-bottom: 0;
 }
 
+.archive .wp-block-post-title,
+.blog .wp-block-post-title,
+.home .wp-block-post-title {
+	margin-bottom: calc( 0.5 * var(--wp--custom--margin--vertical));
+}
+
+.archive .wp-block-post-excerpt__excerpt,
+.blog .wp-block-post-excerpt__excerpt,
+.home .wp-block-post-excerpt__excerpt {
+	margin-top: calc( 0.5 * var(--wp--custom--margin--vertical));
+	margin-bottom: calc( 0.5 * var(--wp--custom--margin--vertical));
+}
+
+.archive .wp-block-post-date,
+.blog .wp-block-post-date,
+.home .wp-block-post-date {
+	text-decoration: underline;
+	text-decoration-thickness: 0.07em;
+	text-underline-offset: 0.46ex;
+}
+
 /*# sourceMappingURL=theme.css.map */

+ 5 - 5
skatepark/block-templates/index.html

@@ -1,10 +1,10 @@
 <!-- wp:template-part {"slug":"header","tagName":"header"} /-->
 
-<!-- wp:group {"tagName":"main","style":{"spacing":{"padding":{"top":"2.5em"}}},"layout":{"inherit":true}} -->
-<main class="wp-block-group" style="padding-top:2.5em">
+<!-- wp:group {"tagName":"main","style":{"spacing":{"padding":{"top":"2.5em","bottom":"2.5em"}}},"layout":{"inherit":true}} -->
+<main class="wp-block-group" style="padding-top:2.5em;padding-bottom:2.5em">
 	<!-- wp:query-title {"type":"archive","align":"wide"} /-->
 	<!-- wp:query {"query":{"perPage":6,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3},"align":"wide"} -->
-<div class="wp-block-query alignwide"><!-- wp:post-template -->
+	<div class="wp-block-query alignwide"><!-- wp:post-template -->
 	<!-- wp:group {"style":{"spacing":{"padding":{"top":"30px","right":"30px","bottom":"30px","left":"30px"}}},"layout":{"inherit":false}} -->
 	<div class="wp-block-group" style="padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px"><!-- wp:separator {"className":"is-style-wide"} -->
 	<hr class="wp-block-separator is-style-wide"/>
@@ -14,9 +14,9 @@
 	
 	<!-- wp:post-title {"isLink":true,"fontSize":"normal"} /-->
 	
-	<!-- wp:post-excerpt /-->
+	<!-- wp:post-excerpt {"className":"is-style-indented-post-excerpt"} /-->
 	
-	<!-- wp:post-date /--></div>
+	<!-- wp:post-date {"style":{"typography":{"fontWeight":"500"}},"fontSize":"tiny"} /--></div>
 	<!-- /wp:group -->
 	<!-- /wp:post-template -->
 	

+ 9 - 0
skatepark/inc/block-styles.php

@@ -41,6 +41,15 @@ if ( ! function_exists( 'skatepark_register_block_styles' ) ) :
 					'style_handle' => 'indented-paragraph',
 				)
 			);
+	
+			register_block_style(
+				'core/post-excerpt',
+				array(
+					'name'         => 'indented-post-excerpt',
+					'label'        => __( 'Indented post excerpt', 'skatepark' ),
+					'style_handle' => 'indented-post-excerpt',
+				)
+			);
 		}
 	}
 endif;

+ 4 - 0
skatepark/sass/base/_mixins.scss

@@ -0,0 +1,4 @@
+@mixin text-decoration() {
+	text-decoration-thickness: 0.07em;
+	text-underline-offset: 0.46ex;
+}

+ 3 - 0
skatepark/sass/block-styles/_indented-paragraph.scss

@@ -1,3 +1,6 @@
 .is-style-indented-paragraph {
 	text-indent: 10em;
+}
+.is-style-indented-post-excerpt p {
+	text-indent: 5em;
 }

+ 10 - 0
skatepark/sass/blocks/_query.scss

@@ -0,0 +1,10 @@
+.wp-block-query-pagination{
+	.wp-block-query-pagination-numbers {
+		.current {
+			@include text-decoration;
+		}
+		.page-numbers {
+			padding: 10px;
+		}
+	}
+}

+ 0 - 1
skatepark/sass/blocks/_separator.scss

@@ -3,5 +3,4 @@
 	&.is-style-wide {
 		border-bottom: 3px solid #000;
 	}
-
 }

+ 1 - 2
skatepark/sass/elements/_links.scss

@@ -1,6 +1,5 @@
 a {
-	text-decoration-thickness: 0.07em;
-	text-underline-offset: 0.46ex;
+	@include text-decoration;
 }
 
 .wp-block-post-content p a {

+ 11 - 0
skatepark/sass/templates/_index.scss

@@ -4,4 +4,15 @@
 	.wp-block-query-title {
 		margin-bottom: 0;
 	}
+	.wp-block-post-title{
+		margin-bottom: calc( 0.5 * var(--wp--custom--margin--vertical) );
+	}
+	.wp-block-post-excerpt__excerpt {
+		margin-top: calc( 0.5 * var(--wp--custom--margin--vertical) );
+		margin-bottom: calc( 0.5 * var(--wp--custom--margin--vertical) );
+	}
+	.wp-block-post-date {
+		text-decoration: underline;
+		@include text-decoration;
+	}
 }

+ 2 - 0
skatepark/sass/theme.scss

@@ -1,8 +1,10 @@
 @import "../../blockbase/sass/base/breakpoints"; // Get the mobile-only media query and make it available to this theme's styles
 @import "../../blockbase/sass/base/mixins";
 @import "base/text";
+@import "base/mixins";
 @import "blocks/buttons";
 @import "blocks/post-comments";
+@import "blocks/query";
 @import "blocks/search";
 @import "blocks/separator";
 @import "block-patterns/pre-footer";