theme-experiments icon indicating copy to clipboard operation
theme-experiments copied to clipboard

TT1 blocks: use container blocks with padding controls instead of spacers

Open vindl opened this issue 4 years ago • 4 comments

Currently we are using Spacer blocks to simulate padding within Header and Footer areas in this theme.

Screenshot 2021-02-23 at 14 46 26

Would it make sense to replace these with Group block (or similar) that would allow us to control the padding via its block settings:

Screenshot 2021-02-23 at 14 47 48

cc @kjellr

vindl avatar Feb 23 '21 13:02 vindl

I think the question is, is there any open issue about or progress on adding the padding to the template parts?

Like you said the group block is the closest block with padding that we could use, and that means adding two unnecessary wrappers inside the template part . -I much prefer the template parts because they reduce the div soup 🥣

carolinan avatar Feb 23 '21 14:02 carolinan

I think the question is, is there any open issue about or progress on adding the padding to the template parts?

Good point, now that you mention it I think there was an issue for that, but I'm having trouble finding it now.

vindl avatar Feb 23 '21 14:02 vindl

Good point, now that you mention it I think there was an issue for that, but I'm having trouble finding it now.

@vindl Is this one: WordPress/Gutenberg#28845

pagelab avatar Feb 24 '21 23:02 pagelab

I took another look at this today, but I'm not totally sure about adding this to the template part. If we do that, we would have to add the spacing individually in each template that uses this template part. If a user were to edit the spacing in one of those templates, their change won't sync across to every other template.

With the current spacers approach, we're setting the spacing within the template part itself, which means it's defined in one place instead of many. If a user changes it, the spacing will update on all instances of that template part.

We could of course add another wrapping element in the header/footer, and add padding to that. But that results in additional nested items, and I'm not sure that's preferable.

kjellr avatar Aug 19 '21 17:08 kjellr