WordPress / theme-experiments

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

TT1 Blocks: Main element is missing #180

Closed carolinan closed 3 years ago

carolinan commented 3 years ago

The header template part and footer template part correctly uses <header> and <footer> elements But in our wishes to keep the theme simple, the <main> element was not used to wrap the main content.

This is an oversight that has negative impacts on accessibility and it needs to be resolved. More info: https://dequeuniversity.com/rules/axe/4.1/landmark-one-main

carolinan commented 3 years ago

Since the query is not a wrapping element -it has no element, the options are to wrap the query and content in a group block or use template parts.

Template parts are practical for repeated content, I suggest that the simplicity of this theme makes use of group blocks more appropriate.

kjellr commented 3 years ago

I suggest that the simplicity of this theme makes use of group blocks more appropriate.

I agree, that makes sense! I do wonder if maybe the Query block should have an option to accept a wrapper tag though — I imagine that lots of themes will run into this issue. I'll file and issue to discuss in the Gutenberg repo.

Edit: https://github.com/WordPress/gutenberg/issues/28555

carolinan commented 3 years ago

I thought it had been discussed and decided against already.

kjellr commented 3 years ago

Ah perhaps — It's totally possible that I missed it. 😄

mtias commented 3 years ago

Template parts are practical for repeated content, I suggest that the simplicity of this theme makes use of group blocks more appropriate.

Agreed. We have discussed a main or content semantic template part, but it's a bit of overhead for something that seems simpler. Starting with group + tag seems great to me. It's always possible to convert to a template part later if needed.