Fix the headings hierarchy in the Styles sidebar #42496
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Type] Bug
An existing feature does not function as intended
Description
Follow-up to #42373
The headings hierarchy in the Styles sidebar is less than ideal. It skips levels, doesn't follow a logical structure and it appears it was implemented more for visual purposes rather than for good semantics.
Suffice to say the first heading within the Styles sidebar is a H5, which doesn't make sense and it's totally disconnected from the overall headings hierarchy.
A good headings structure is not just about good semantics. Headings are also a navigational tool for screen reader users, as they can use dedicated commands to jump through headings, get a sense of the overall content, and navigate a page. This principle applies also to administration user interfaces, where headings can be used to identify the main parts of the interface.
Step-by-step reproduction instructions
Hint; Use the HeadingsMap browser extension to check the headings hierarchy.
Screenshots, screen recording, code snippet
Worth mentioning the HeadingsMap browser extension only highlights skipped heading levels, and in the screenshot below there are a few headings highlighted as errors. It doesn't evaluate whether a heading level is logically correct or not, which requires evaluation by a human.
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: