Add best practice guidance for the group block element selector #31502
Labels
[Block] Group
Affects the Group Block (and row, stack and grid variants)
[Block] Query Loop
Affects the Query Loop Block
[Block] Template Part
Affects the Template Parts Block
[Package] Block library
/packages/block-library
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
#28576 introduce an element selector to the group block to allow a user to change the container element within a user created template.
While this is great for flexibility, there is no guidance around purpose or proper use of each element and could lead users to construct pages with bad structure and accessibility.
For example, each document must not have more than one
<main>
element. Another example is that the<header>
element could also be easily confused with the page's actual "header" area, but it's not meant to designate a new section on the page (it will not be reflected as a new section in the outline). Instead it should represent a header for the surrounding section.What is your proposed solution?
At the minimum, I think a description of the selected element (potentially with suggested best practices) should be added to the selector. This would provide the user with some clarity and guidance as to how the element can be properly utilized.
At the most, I think we could explore adding some contextual hints to the user. Something that came to mind for me was when a user is warned that the selected colors for a block could potentially be hard for people to read. For the
<main>
element, a warning like this could be displayed if more than 1<main>
tag is detected in the page.The text was updated successfully, but these errors were encountered: