WordPress / theme-experiments

Experimenting with themes made out of blocks.
GNU General Public License v2.0
546 stars 179 forks source link

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

Open vindl opened 3 years ago

vindl commented 3 years ago

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

carolinan commented 3 years ago

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 🥣

vindl commented 3 years ago

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.

pagelab commented 3 years ago

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

kjellr commented 2 years ago

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.