-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blockbase: Add post-meta template part #4565
Conversation
Blockbase was initially a clone of Blank Canvas, which is a child of Seedlet with a few changes, so I think copying what's on Seedlet blocks should be ok, unless Kjell thinks otherwise |
Ok! I've removed the tags as this then matches Seedlet Blocks exactly, but happy to adjust either way. |
I think including tags is fine (I'm not sure why Seedlet Blocks doesn't display them? The original Seedlet does, we just don't use tags on our demo site). You can source the icon straight from Seedlet. I'd also remove the separator:
Also, in my testing, the comments are showing up really close to this new meta area. Not sure if that's just a bug with my test site? |
Thanks @kjellr! I've added the post tags back in, copied the post tag SVG over from Seedlet (this looks great, thanks for pointing me in the right direction), and removed the separator. Seedlet Blocks doesn't include the tags in the post meta template. I could add them here too while I'm working in this area, if you think they should be there? The comments aren't really close on my local dev, looks like they're inheriting the top margin from this selector: They're using the |
Yeah, I think they should be there. Feel free to do it here if you'd like, but it could totally be a separate PR if that's easier. |
If we could make this at least |
I've updated Seedlet Blocks so the post meta now includes the tags: And I managed to replicate the lack of spacing above the post comments block (my Gutenberg was out of date). I've added a spacer block above the post comments on Blockbase that's the same height as This is ready for another review, thanks! |
Thanks, @mikachan! Just one minor comment: Can we increase the gap between items to
After that, I think this is all set for now! |
For what it's worth, I think the theme needs to opt into the new gap feature for that to work? I'm not sure how to actually set the gap for the block though. 🤔 |
So, I have checked the following blocks: If my understanding is correct, gap makes an obvious sense with blocks that will be used in multiple instances together, like With It would almost make sense to have just one block called post meta, and then have different parts inside of the block being |
I think you only need gap support on the Group block, right? Since that's the one that has the |
Thank you! I tried with spacers and then resorted to CSS... but setting I've set the Blockbase gap size to Also, I could only seem to get |
They were all using --wp--custom--margin--vertical instead of --wp--custom--gap--vertical
I think it probably makes sense to keep the default size the same for now. I'm not sure how many places that gap property is used, so I think a more conservative approach is warranted here. |
Thanks! I've set all of the Blockbase children gap sizes to |
Yeah I think they can. I didn't do this originally as I only tried Blockbase: Seedlet Blocks: Mayland Blocks: Quadrat: (This doesn't affect Skatepark and Geologist.) |
This looks great. One last question: Is it possible to specify a different vertical/horizontal gaps? If these meta items wrap, it uses the same horizontal gap for the vertical spacing: I'd prefer if the vertical spacing was half of that: If that's not possible yet, it's ok, and we can merge this as-is for now. Thank you! |
From what I can tell, the new blockGap feature only supports one value, and can't yet split out different horizontal and vertical gaps. It looks like there's an ongoing issue for it though: WordPress/gutenberg#34529 (and there's an issue from @scruffian here too: WordPress/gutenberg#34347) We could set the vertical gap for the post-meta with CSS until this feature is available? Although it looks like it's tricky to overwrite the specific
|
Maybe we could set it via CSS just for the post meta? |
This is now applied via theme.json (as the same value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one minor comment, but otherwise I think this is good to go. Thank you! 🙌
blockbase/sass/post/_meta.scss
Outdated
@@ -1,4 +1,6 @@ | |||
.post-meta { | |||
row-gap: var(--wp--custom--gap--baseline) !important; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to add a code comment here to explain why we're using !important
. And we can also probably remove that empty line below.
@@ -1,4 +1,5 @@ | |||
.post-meta { | |||
row-gap: var(--wp--custom--gap--baseline) !important; // !important is needed to override the unique .wp-container-ID classes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to link the GB issue that suggests different vertical and horizontal block gaps, so we can remove this when that gets fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah good idea, will sort this now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes proposed in this Pull Request:
This PR adds a post-meta template part to Blockbase.
I've mostly copied the Seedlet Blocks, Mayland Blocks, and Skatepark post-meta. I've used the 'tiny' font size; I did try 'small' as well but I thought 'tiny' probably looked better overall.
@kjellr, I know you mentioned in the original issue that we could maybe just include the post date to start with. Let me know if you think we should use different content - for now, I've gone with: author, date, categories, tags.
We're missing the correct 'post-tag' SVG icon (I think) - I've used an outline version of the 'offer' Material icon, but I think the line thickness is slightly different from the other icons. I'm not sure how we usually create the SVGs, so just pointing out that this one probably needs creating/replacing!
Related issue(s):
Closes #4522.