Skip to content

Commit

Permalink
Blockbase: Add post-meta template part (#4565)
Browse files Browse the repository at this point in the history
* Blockbase: add post-meta template part

* Blockbase: add post-tag icon

* Blockbase: remove tags from post meta

* Blockbase: add post tags to post meta

* Blockbase: add post tag SVG from Seedlet

* Blockbase: remove separator from post meta

* Blockbase: add spacer above post comments block

* Seedlet Blocks: add post tags to post meta

* Blockbase: enable blockGap & set gap size for all children

* Blockbase children: sync up child-theme.json files

They were all using --wp--custom--margin--vertical instead of --wp--custom--gap--vertical

* Blockbase children: change gap size to GB default of 0.5em

* Blockbase & co: use gap baseline across BB & all children

* Blockbase: add row-gap value to post-meta

* Skatepark: remove gap value

This is now applied via theme.json (as the same value)

* Blockbase: add comment next to use of !important

* Blockbase: add link to GB issue around block gaps
  • Loading branch information
mikachan authored Sep 20, 2021
1 parent 0d25520 commit d8926ce
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 10 deletions.
4 changes: 4 additions & 0 deletions blockbase/assets/ponyfill.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions blockbase/assets/svg/post-tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions blockbase/block-template-parts/post-meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- wp:group {"className":"post-meta","layout":{"type":"flex"}} -->
<div class="wp-block-group post-meta">
<!-- wp:post-author {"showAvatar":false,"showBio":false,"fontSize":"tiny"} /-->
<!-- wp:post-date {"fontSize":"tiny","isLink":true} /-->
<!-- wp:post-terms {"term":"category","fontSize":"tiny"} /-->
<!-- wp:post-terms {"term": "post_tag", "fontSize":"tiny"} /-->
</div>
<!-- /wp:group -->
9 changes: 8 additions & 1 deletion blockbase/block-templates/singular.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@
<!-- wp:post-featured-image {"align":"full"} /-->

<!-- wp:post-content {"layout":{"inherit":true}} /-->

<!-- wp:template-part {"slug":"post-meta","layout":{"inherit":true}} /-->
</main>
<!-- /wp:group -->

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group"><!-- wp:post-comments /--></div>
<div class="wp-block-group">
<!-- wp:spacer {"height":60} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:post-comments /-->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
3 changes: 3 additions & 0 deletions blockbase/sass/post/_meta.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.post-meta {
// We're setting row-gap here as currently, we can't specify separate vertical and horizontal block gaps.
// Tracking in Gutenberg here: https://github.com/WordPress/gutenberg/issues/34529
row-gap: var(--wp--custom--gap--baseline) !important; // !important is needed to override the unique .wp-container-ID classes
.wp-block-post-author,
.wp-block-post-date,
.taxonomy-post_tag,
Expand Down
3 changes: 2 additions & 1 deletion blockbase/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"wideSize": "1000px"
},
"spacing": {
"blockGap": true,
"customPadding": true,
"units": [
"%",
Expand Down Expand Up @@ -571,7 +572,7 @@
}
},
"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
"blockGap": "calc(2 * var(--wp--custom--gap--baseline))"
},
"typography": {
"lineHeight": "var(--wp--custom--body--typography--line-height)",
Expand Down
3 changes: 2 additions & 1 deletion geologist/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
"wideSize": "1128px"
},
"spacing": {
"blockGap": true,
"customPadding": true,
"units": [
"%",
Expand Down Expand Up @@ -641,7 +642,7 @@
}
},
"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
"blockGap": "calc(2 * var(--wp--custom--gap--baseline))"
},
"typography": {
"lineHeight": "var(--wp--custom--body--typography--line-height)",
Expand Down
3 changes: 2 additions & 1 deletion mayland-blocks/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
"wideSize": "1000px"
},
"spacing": {
"blockGap": true,
"customPadding": true,
"units": [
"%",
Expand Down Expand Up @@ -593,7 +594,7 @@
}
},
"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
"blockGap": "calc(2 * var(--wp--custom--gap--baseline))"
},
"typography": {
"lineHeight": "var(--wp--custom--body--typography--line-height)",
Expand Down
3 changes: 2 additions & 1 deletion quadrat/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
"wideSize": "1128px"
},
"spacing": {
"blockGap": true,
"customPadding": true,
"units": [
"%",
Expand Down Expand Up @@ -667,7 +668,7 @@
}
},
"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
"blockGap": "calc(2 * var(--wp--custom--gap--baseline))"
},
"typography": {
"lineHeight": "var(--wp--custom--body--typography--line-height)",
Expand Down
4 changes: 3 additions & 1 deletion seedlet-blocks/block-template-parts/post-meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@

<!-- wp:post-date {"fontSize":"tiny","isLink":true} /-->

<!-- wp:post-terms {"term":"category","fontSize":"tiny"} /--></div>
<!-- wp:post-terms {"term":"category","fontSize":"tiny"} /-->

<!-- wp:post-terms {"term": "post_tag", "fontSize":"tiny"} /--></div>
<!-- /wp:group -->
3 changes: 2 additions & 1 deletion seedlet-blocks/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
"wideSize": "790px"
},
"spacing": {
"blockGap": true,
"customPadding": true,
"units": [
"%",
Expand Down Expand Up @@ -627,7 +628,7 @@
}
},
"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
"blockGap": "calc(2 * var(--wp--custom--gap--baseline))"
},
"typography": {
"lineHeight": "var(--wp--custom--body--typography--line-height)",
Expand Down
1 change: 0 additions & 1 deletion skatepark/assets/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions skatepark/child-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@
}
}
},
"spacing": {
"blockGap": "0.5em"
},
"typography": {
"fontFamily": "var(--wp--preset--font-family--red-hat-display)",
"fontWeight": "400"
Expand Down
1 change: 0 additions & 1 deletion skatepark/sass/elements/_post-meta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
&.wp-block-group {
flex-direction: column;
align-items: start;
gap: .5em;
}

.wp-block-post-date,
Expand Down
3 changes: 2 additions & 1 deletion skatepark/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
"wideSize": "1194px"
},
"spacing": {
"blockGap": true,
"customPadding": true,
"units": [
"%",
Expand Down Expand Up @@ -652,7 +653,7 @@
}
},
"spacing": {
"blockGap": "var(--wp--custom--gap--vertical)"
"blockGap": "0.5em"
},
"typography": {
"lineHeight": "var(--wp--custom--body--typography--line-height)",
Expand Down

0 comments on commit d8926ce

Please sign in to comment.